Skip to main content

new linux variable update in ES

  • December 1, 2018
  • 1 reply
  • 0 views

I have added the missing variable in /etc/profile.d/microfocus.sh file and its now reflecting on the system, however since the job is being processed through JCL  and the variable is not reflected under Microfocus Environment Variable, t Upon my testing on test environment, I see that , the Microfocus Instance restart can get the newly defined environment variable to get reflected on the Microfocus Environment variable list.
Could you confirm if Instance restart is the only way or if there is any other solution


#EnterpriseDeveloper
#microfocusenterprisedeveloperforeclipse
#EnterpriseServer

1 reply

  • Author
  • Rocketeer
  • 19312 replies
  • December 5, 2018

I have added the missing variable in /etc/profile.d/microfocus.sh file and its now reflecting on the system, however since the job is being processed through JCL  and the variable is not reflected under Microfocus Environment Variable, t Upon my testing on test environment, I see that , the Microfocus Instance restart can get the newly defined environment variable to get reflected on the Microfocus Environment variable list.
Could you confirm if Instance restart is the only way or if there is any other solution


#EnterpriseDeveloper
#microfocusenterprisedeveloperforeclipse
#EnterpriseServer

Your question is not entirely clear to me. However, in general, there are two ways that the environment of a process can be modified:

  1. The initial environment is set by the parent process, either explicitly or by inheriting the current environment of the parent process.
  2. A process can modify its own environment. One process cannot modify the environment of another process (except in the unusual case of one process injecting data or code into another).

Thus you cannot, in general, modify the environment of the Enterprise Server SEP processes after they have been started, using some external facility. It doesn't matter how you set your environment variable.

In theory it should be possible to change the environment of a single SEP process while it's running by executing code in it that calls the putenv() library function. This would be a bad idea for various reasons, particularly the difficulty of ensuring the code ran in all SEPs.

It should also be possible to write a JCL exit handler that, prior to any application code being executed, read a file and used putenv() or an equivalent, such as COBOL's display upon environment-name / environment-value, to set environment variables for the SEP executing the job. This seems like rather a lot of work compared to the simpler solution of figuring out what environment variables you need ahead of time, and setting them before you start the region. (Minimizing the use of environment variables is also a good idea. They are a poor configuration mechanism.)

Incidentally, Enterprise Server has a configuration mechanism specifically for setting environment variables for an ES region. In the region definition in Enterprise Server Administrator, on the General tab, there is a textbox for custom configuration. There you can create (or add to, if it already exists) a section named [ES-Environment] with environment variable settings:

[ES-Environment]
# This is a comment
MYVAR=some value
MYVAR2=some other value

Also, it's "Micro Focus". Two words.