Skip to main content

I have a weird requirement where i have two MF servers (say Server1 and Server2) on one windows server  and I am running a job on server1 which need to access environment variable of server2 .

Early reply is much appreciated


#EnterpriseServer
#MFstudioEE

I have a weird requirement where i have two MF servers (say Server1 and Server2) on one windows server  and I am running a job on server1 which need to access environment variable of server2 .

Early reply is much appreciated


#EnterpriseServer
#MFstudioEE

There's no straightforward way for one process to inspect the environment of an unrelated process. That's not a limitation of Micro Focus Enterprise Server or COBOL; it's how the environment feature in the OS is designed to work.

The most straightforward way to accomplish what you're looking to do is to have a program running under Server 1 write the environment variable's value to a file, and then read that file from the program running under Server 2. That's assuming the environment variable is established at region startup and doesn't change while the region is running.

If the program on Server 2 needs to know what the environment variable's value is now, then you have a problem. Environment variables are specific to a process, so there's no way of ensuring the variable has the same value in all of the SEPs running under Server 1. You could deploy a simple web service to Server 1 that would return the value of the environment variable, and invoke that web service from the program running under Server 2, but you'd get whatever value it has in whichever SEP handled the request.

It would help to know more about what you're trying to do.