Job Management Partner 1/Automatic Job Management System 3 Command Reference 1
The following table shows the environment variables that are set when a job is executed.
Table 1-7 Environment variables set for job execution
Environment variable Description AJSENV Allows you to identify that the job has been started as scheduled.
Usually, this variable is set to YES.AJSPRE_ST Sets the character indicating the end status of the preceding job or jobnet.
One of the following characters is specified:
n: Normal end
w: Ended with warning
a: Abnormal end
If there are two or more preceding jobs or jobnets, the highest level of seriousness is set. If there is no preceding job or jobnet, n (normal end) is set. For a starting job for re-execution, the status of the preceding job or jobnet of the starting job is set. If the re-execution changes the status of the preceding job or jobnet to normal end or end with warning, the changed value is set.AJSPRE_RC Sets the return value for the preceding job (-2,147,483,648 to 2,147,483,647). If there are two or more preceding jobs, the logical OR of all return values is set. If there is no preceding job, 0 is set. For a starting job for re-execution, the return value for the previous execution is set. AJSNETNAME Sets the root jobnet name (character string of up to 899 bytes). AJSJOBNAME Sets the job name (character string of up to 930 bytes). AJSHOST Sets the name of the manager host (character string of up to 255 bytes) which has requested the execution of the job. AJS_AJSCONF Sets the scheduler service name of the manager host (character string of up to 30 bytes) which has requested the execution of the job. AJSEXDATE Sets the scheduled date of starting root jobnet execution (in the yyyy/mm/dd format). If the execution of the jobnet is delayed or the job is re-executed on the next day, the original scheduled date is set. AJSEXECID Sets the job execution ID (character string of up to 10 bytes). AJSEXECPID Sets the execution ID of the generation for which a start condition is monitored (character string of up to 10 bytes).
No value is set if a start condition is not monitored.JP1_HOSTNAME Sets a logical host name for only a logical host.#1 JP1JobName Sets the execution file name or job name (character string of up to 63 bytes). If a job name has been specified in a QUEUE job or jpqjobsub command, that job name is set. If a job name has not been specified for a PC job, Unix job, QUEUE job, or action job, the execution file name is set.
For the execution file name, the system assumes the first 63 bytes of the file name (excluding the path).JP1JobID Sets the job number (1 to 999,999). For a queueless job, this variable sets the ID (character string of up to 10 bytes) that is used internally. JP1UserName Sets the name of the user who has submitted the job (character string of up to 63 bytes). JP1_USERNAME Sets the name of the user who has submitted the job (character string of up to 63 bytes). JP1UNCName Sets the name of the agent host that is running the job (character string of up to 255 bytes). JP1NBQSQueueName Sets the name of the manager host with which the job is registered (character string of up to 255 bytes) and the queue name (character string of up to 63 bytes) in \\manager-host-name\queue-name format.
Sets the name of the agent host (character string of up to 255 bytes) instead of the queue name if the execution host is specified. For a queueless job, this variable does not set anything.JP1NBQSClientName (Windows only) Sets the name of the client computer which has entered the job (character string of up to 15 bytes). For a queueless job, this variable does not set anything. JP1Priority Sets the execution priority for the job (1 to 5 for the UNIX version and 32, 64, or 128 for the Windows version; 64 = low, 32 = middle, 128 = high). HOME (UNIX only) Sets the login directory defined in the password file of the job-specified execution user. If no execution user is specified, the OS user corresponding to the JP1 user having registered the jobnet is set as the execution user. SHELL (UNIX only) Sets the execution shell required to execute jobs. Execution shells are determined according to the following levels of priority. Note that the shell to set changes depending on how the job is registered.
In the following cases, the first listed shell has the highest priority level:
- When Command statement is not specified for a job that will be executed in a jobnet
- The shell specified on the first line of the script file specified for the job
- The login shell defined in the password file of the user who executes the job
- /bin/sh
- When Command statement is specified for a job that will be executed in a jobnet#2
- The shell specified on the first line of Command statement specified for the job
- The login shell defined in the password file of the user who executes the job
- /bin/sh
- When the jpqjobsub command is used to execute the job
- The shell specified on the first line of the script file specified for the job
- The shell path name specified in the jpqjobsub command's -shl option
- The login shell defined in the execution user's password file
- /bin/sh
LANG (UNIX only) Sets the LANG environment variable for use at the JP1/AJS3 startup. JP1/AJS3 for Windows usually does not read user environment variables. When a cluster system is set up, however, user environment variables are read according to the MSCS specifications. LONGNAME (UNIX only) Sets the name of the execution user specified in the job. If no execution user is specified, the OS user corresponding to the JP1 user having registered the jobnet is set as the execution user. MAIL (UNIX only) Sets /usr/mail/execution-user-name, where execution-user-name refers to the job-specified execution user or the OS user corresponding to the JP1 user having registered the jobnet. PATH (UNIX only) Sets /bin:/usr/bin.#2
- Notes
- The environment variables listed in Table 1-7 cannot be used as environment variables for job definition. They cannot be used within any file specified as an environment file either.
- For AIX, the information for /etc/environment is not inherited.
- Do not use any environment variable starting with JP1, AJS, or AJS2 (case-insensitive).
- The TZ environment variable is not set during job execution. If you need the TZ environment variable, set it for an environment variable in a job definition or in a file that is specified as an environment variable file.
- Environment variables beginning with AJS are set only when a job is registered from a jobnet. They are not set in a submit job.
- #1
- In UNIX:
- When you specify JP1/AJS3 as the execution target service in the detailed definition of a job
The logical host name specified in the -h option of the jajs_spmd command is set.
If you omit the -h option, and the value of the JP1_HOSTNAME environment variable has been set, that value is passed as the logical host. Nothing is set for a physical host.
- When you specify JP1/AJS3 Queueless Agent as the execution target service in the detailed definition of a job
If the host that executes the job is a logical host, the value specified as the execution agent in the detailed definition of the job is set. Nothing is set when the host that executes the job is a physical host.
- In Windows:
- When you specify JP1/AJS3 as the execution target service in the detailed definition of a job
For a logical host, the logical host name is set in the JP1_HOSTNAME environment variable at the startup of the JP1/AJS3 service. Nothing is set for a physical host.
- When you specify JP1/AJS3 Queueless Agent as the execution target service in the detailed definition of a job
If the host that executes the job is a logical host, the value specified as the execution agent in the detailed definition of the job is set. Nothing is set when the host that executes the job is a physical host.
- #2
- If a shell is specified on the first line of the script file specified in Script file name when a command statement is also specified in Command statement, the specification of the shell has no effect.
- #3
- When a job is started from JP1/AJS3, JP1/AJS3 will explicitly set the /bin:/usr/bin value in the PATH environment variable. If you want to set any other value, you must set the value in a definition of the command or script file specified when the job was defined, or a definition in the local login script.
Usually, environment variables are set in JP1/AJS3. Those variables include those listed in Table 1-7, as well as those specified for job definition, and those contained in files specified as environment files for job definition. In addition, environment variables may also be set in the command statements, script files, local login scripts, and system login scripts specified for job definition. If the same environment variables are found in these, they will be valid according to the following levels of priority (with the value of 1 as the highest level).
- Windows
- Environment variables specified for Environment variables#1.
- Environment variables specified for Environment file#2.
- System environment variables
- UNIX
- Definitions in the commands or script files specified for job definition
- Definitions contained in local login scripts
- Definitions contained in system login scripts
- Environment variables specified for Environment variables#1.
- Environment variables specified for Environment file#2.
- #1
- Variables specified for Environment variables in the JP1/AJS3 - View window or those specified with the -env option for the jpqjobsub command.
- #2
- Variable files specified for Environment file in the JP1/AJS3 - View window or those specified with the -ev option for the jpqjobsub command.
- Cautionary note
- In Windows, JP1/AJS3 is usually started as a JP1/AJS3 service and does not read user environment variables. When you start a job from JP1/AJS3, JP1/AJS3 sets the system environment variables that are read when it is started. When a cluster system is set up, however, the user environment variables will be valid in the JP1/AJS3 service (logical hosts only) started by MSCS. This is because MSCS reads user environment variables according to the MSCS specifications. For any non-MSCS cluster software, refer to the relevant specifications. Note that the environment variables read when the JP1/AJS3 service starts include not only the system environment variables but also the environment variables that are set at OS startup. Also note that the environment variables specified in the login script are not read.
Copyright (C) 2009, 2010, Hitachi, Ltd.
Copyright (C) 2009, 2010, Hitachi Solutions, Ltd.