7.3.18 export parameter (defines an environment variable)
Syntax
export environment-variable-name=environment-variable-value
Description
This parameter defines an environment variable that is to take effect when job definition scripts are executed.
Arguments
- environment-variable-name ~<environment variable name>((1 to 255 bytes))
Specifies a name for the environment variable being defined.
In Windows, the name of the environment variable is loaded as an uppercase shell variable name when DISABLE is specified for the VAR_ENV_NAME_LOWERCASE environment setting parameter.
- environment-variable-value ~<any character string>
Specifies the value to be set in the environment variable.
You can specify an environment variable value containing a space by enclosing it in double-quotation marks (") or single quotation marks (') or by specifying an escape character (\) before the space. If a character string enclosed in double quotation marks (") contains the escape character (\), all the characters following \ are treated as escaped characters. Therefore, to specify \ as a part of a character string enclosed in double quotation marks, specify \\ instead of \.
You can insert the current value of the PATH environment variable by specifying ${PATH} in a desired character string. Specify ${PATH} at the target location in the following format:
export environment-variable-name=[any-character-string]${PATH}[any-character-string]
${PATH} is replaced with the value of the PATH environment variable regardless of the specification of double-quotation marks ("), single quotation marks ('), and escape characters (\). The specified double-quotation marks ("), single quotation marks ('), or escape characters (\) take effect on the entire character string inserted as the value of the PATH environment variable, and then the value is set in the environment variable.
If you define the PATH environment variable in Windows, enclose the value of the PATH environment variable in single quotation marks (') so that the resulting value containing a space or \ is interpreted correctly.
Notes
If this parameter is defined in both the system environment file and the job environment file, the environment variable is set in the following order:
Environment variable specified in the system environment file
Environment variable specified in the job environment file
Even when a value for the LANG environment variable is specified by the export parameter, the locale of the process of the adshexec command that loaded this environment-setting parameter is not changed. (UNIX only)
-
The upper limit of the character string length that can be stored in the environment variable is 32,766 bytes. In Windows, when a long character string is stored in the PATH environment variable, an error may occur with the API of the OS even when the character string has not exceeded the upper limit. For this reason, refrain from storing a character string that is close to the upper limit.
Example
This example sets the value of environment variable BBB in environment variable AAA:
export AAA=BBB
This is an example of incorrectly setting the value of environment variable BBB in environment variable AAA:
AAA=BBB export AAA
This example adds /opt/jp1as/bin to the existing PATH environment variable:
export PATH=/opt/jp1as/bin:${PATH}
The colon (:) is used as the path separator.
This example adds C:\Program Files\HITACHI\JP1AS\JP1ASE\bin to the existing PATH environment variable:
export PATH='C:\Program Files\HITACHI\JP1AS\JP1ASE\bin;${PATH}'
The semicolon (;) is used as the path separator.