Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide


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

ADSH_AJS_ENVF

Job environment file name for custom jobs

When the job starts as a custom job

Yes#1

ADSH_AJS_GCHE

Check option for custom jobs

When the job starts as a custom job

Yes#1

ADSH_AJS_LHOST

Logical host name for custom jobs

When the job starts as a custom job

Yes#1

ADSH_AJS_SCRF

Job definition script file name for custom jobs

When the job starts as a custom job

Yes#1

ADSH_ENV

Job environment file name

When the job starts as a custom job

Yes#2

ADSH_CMD_ARGORDER#3

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

ADSH_CMDEXPR_LENGTH

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

ADSH_JOB_NAME

Job name

When the job starts

No

ADSH_JOBID

Job ID (fixed 6-digit decimal number with leading zeros added)

When the job starts

No

ADSH_JOBRC_FATAL

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

ADSH_LANG

(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

ADSH_LANG_JP1EVENT

(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

ADSH_STEP_NAME

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

AJS_BJEX_STOP

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.)

BLOCKSIZE

Number of bytes per block. This environment variable is used in the ls and stat commands.

The default is 512.

(Not specified automatically.)

Yes

COLUMNS

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.)

GETOPT_COMPATIBLE

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

POSIXLY_CORRECT#3

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.)

TMPDIR

(UNIX only)

Directory to which temporary files are output. This environment variable is used in the diff and sort commands.

(Not specified automatically.)

Yes

#1

These environment variables can be used only in the unit definitions in JP1/AJS's ajsdefine command and in the job definitions in JP1/AJS - Definition Assistant. Do not use these environment variables in the JP1/Advanced Shell's job definition scripts or user environments, such as user profiles and system profiles.

#2

If an 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 or root job that is started from a job definition script.

#3

The POSIXLY_CORRECT environment variable has effect in the standard Linux OS commands as well as in the commands in which the ADSH_CMD_ARGORDER environment variable has effect, but the environment variable might have additional functionality than the rule for determining the specification order of the command arguments. Therefore, if the only thing you want to do is to set a rule for determining the specification order for command arguments for UNIX-compatible commands, use the ADSH_CMD_ARGORDER environment variable.

#4

The ADSH_LANG environment variable is prioritized over the LANG environment variable. If the ADSH_LANG environment variable is not specified, messages are output in the language and encoding specified in the LANG environment variable. If neither the ADSH_LANG environment variable nor the LANG environment variable is specified, the value C is assumed.

#5

The ADSH_LANG_JP1EVENT environment variable takes priority over both the ADSH_LANG and the LANG environment variables.

If the ADSH_LANG_JP1EVENT environment variable is not specified, messages are output in the language specified in the ADSH_LANG environment variable. If neither the ADSH_LANG_JP1EVENT nor the ADSH_LANG environment variable is specified, messages are output in the language specified in the LANG environment variable.

If the ADSH_LANG environment variable is set to a value other than C, or if the ADSH_LANG environment variable is not specified and the LANG environment variable is set to a value other than C, messages that are output by JP1 events are output in Japanese. In such a case, if you want JP1 event messages to be output in English, set the ADSH_LANG_JP1EVENT environment variable to C.

#6

If you execute the adshmdctl command with this environment variable specified, messages to the syslog are also output in the language and encoding specified in the ADSH_LANG environment variable.

Depending on the system, outputting the character codes of the language and encoding to the syslog might be impossible. In this case, do not use the adshmdctl command with this environment variable specified.

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.