The EnvironmentVariable class and the EnvironmentVariableList class enable you to access and set iSeries™ system-level environment variables.
Each variable has unique identifiers: the system name and the environment variable name. Each environment variable is associated with a CCSID, which is by default the CCSID of the current job, which describes where the contents of the variable are stored.
Use an EnvironmentVariable object to perform the following actions on an environment variable:
// Create the iSeries system object. AS400 system = new AS400("mySystem"); // Create the foreground color environment variable and set it to red. EnvironmentVariable fg = new EnvironmentVariable(system, "FOREGROUND"); fg.setValue("RED"); // Create the background color environment variable and get its value. EnvironmentVariable bg = new EnvironmentVariable(system, "BACKGROUND"); String background = bg.getValue();