2.5 Specifying environment variables
The table below lists and describes the environment variables supported by JP1/Advanced Shell.
- Important note
-
JP1/Advanced Shell sets and references shell and environment variables whose names begin with ADSH. Therefore, do not use a shell variable or an environment variable whose name begins with ADSH for any purpose other than those described in this manual.
Table 2‒11: Environment variables supported by JP1/Advanced Shell Environment variable name
Information to be specified
Timing of specification when the value is set automatically
Whether a value can be specified
Job environment file name for custom jobs
When the job starts as a custom job
Yes#1
Check option for custom jobs
When the job starts as a custom job
Yes#1
Logical host name for custom jobs
When the job starts as a custom job
Yes#1
Job definition script file name for custom jobs
When the job starts as a custom job
Yes#1
Job environment file name
When the job starts as a custom job
Yes#2
Rule for determining the order of the command arguments specified on the command line. The only permitted value is seq.
This environment variable has effect in the cut, date, diff, expand, ls, and stat commands. It also has effect in the analysis of user-defined options in the getopt command.
(Not specified automatically.)
Yes
Character string length. This environment variable is specified when the length operator is used in the expr command.
Specify b to acquire the character string length in bytes, and specify c to acquire the character string length in characters.
If this environment variable is omitted or a value other than b or c is specified, length is not treated as an operator.
(Not specified automatically.)
Yes
Job name
When the job starts
No
Job ID (fixed 6-digit decimal number with leading zeros added)
When the job starts
No
Job return code in the event of a fatal error that interrupts job processing such as syntax errors.
For details about how to specify the environment variable, see 2.6.15(2) ADSH_JOBRC_FATAL environment variable (specifies the return code in the event of an unresumable error in jobs.
(Not specified automatically.)
Yes#2
(UNIX only)#4#6
The language and encoding in which messages are output by JP1/Advanced Shell.
Set this environment variable if you want to temporarily change the messages that the adshexec command for a specific job outputs.
For details about the values that you can specify, see 2.2.4 Encoding used in JP1/Advanced Shell.
If this environment variable is set within a job definition script or an environment file, the value of such an environment variable is valid only for a child job, root job, or shell operation command (other than the adshexec command) that starts from a job definition script.
(Not specified automatically.)
Yes
(UNIX only)#5
The language of messages output by JP1 events that are generated by the user-reply functionality.
Set this environment variable if you want JP1 event messages to be output in a different language, in accordance with the settings of JP1/IM at the output destination, from the language in which messages are output by JP1/Advanced Shell.
For details about the specifiable values, see 2.2.4 Encoding used in JP1/Advanced Shell.
If this environment variable is set within a job definition script, the value of such an environment variable is valid only for a child job, root job, or shell operation command (other than the adshexec command) that starts from a job definition script.
If this environment variable is set within an environment file, JP1 event messages from a job definition script are output in the language that conforms to the value.
(Not specified automatically.)
Yes
Job step name. When a command outside the job step is executed or when a job step name is omitted, the environment variable is not defined.
When the job step starts
No
Interface used for forced termination from JP1/AJS.
This environment variable must be defined when JP1/Advanced Shell batch jobs are defined in PC or UNIX jobs. Define the environment variable in PC or UNIX job definitions, not in OS settings.
When the job starts as a custom job
Yes (Only TERM is permitted.)
Number of bytes per block. This environment variable is used in the ls and stat commands.
The default is 512.
(Not specified automatically.)
Yes
Output width per line of command execution results. This environment variable is used in the -C option of the ls command and the l editing command of the sed command (edit command).
This environment variable cannot be defined in job definition scripts.
(Not specified automatically.)
Yes (Cannot be specified in job definition scripts.)
Parameter analysis method. This environment variable is used in the getopt command.
There is no rule for the value to be set. If a value is set, JP1/Advanced Shell assumes that the getopt command is specified in format 1 for all arguments to be analyzed.
(Not specified automatically.)
Yes
Rule for determining the order of the command arguments specified on the command line.
There is no rule for the value to be set. If a value is set, the handling is the same as when seq is specified in the ADSH_CMD_ARGORDER environment variable.
This environment variable cannot be defined in job definition scripts.
(Not specified automatically.)
Yes (Cannot be specified in job definition scripts.)
(UNIX only)
Directory to which temporary files are output. This environment variable is used in the diff and sort commands.
(Not specified automatically.)
Yes
From job definition scripts, you can reference the default environment variables that are set by the OS and the environment variables that are specified in the export parameter in the environment files, in addition to the environment variables listed in the above table. For details about the export parameter, see export parameter.