Porting Central
Skip to main content

Porting Central

Environment variables

Does OS/400 ILE environment support environment variables?

Yes. OS/400 supports environment variables through numerous APIs and CL commands. Here is a program that gets and sets value of environment variable. However, OS/400 does not automatically set a default set of environment variables for a user at sign on time. If a default set of environment variables is expected, a progam may be called to set up the environment.

How does OS/400 PASE support environment variables?

If you use one of the OS/400 PASE "launch" programs (QP2TERM or QP2SHELL), environment variables you set in ILE are copied over (such as language and CCSID). When you use the QP2RunPase() API, these variables are not automatically set up for you. Instead, you must pass in the environment variables that you want set in OS/400 PASE

For OS/400 PASE, there are some environment variables that start with "PASE_". These are copied into the OS/400 PASE environment and set as the environment variables without the "PASE_" prefix in front of the name. The reason for these new variables is that you may want to have environment variables set differently in the same job for ILE than for OS/400 PASE. For example, if you want an ASCII CCSID in OS/400 PASE and an EBCDIC CCSID in ILE, this allows you to set them both separately without a name collision between them. Another example is the LIBPATH variables and the PASE_LIBPATH variable so you could have two different search paths for executables within a job.

If an OS/400 PASE program changes an environment variable, the change is not reflected back to ILE when the OS/400 PASE program exits.

[BACK]