Hitachi

JP1 Version 12 JP1/Automatic Job Management System 3 Command Reference


1.4.2 Environment variables set when a job is executed from JP1/AJS3

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#1

Sets the root jobnet name (character string of up to 899 bytes).

AJSJOBNAME#1

Sets the job name (character string of up to 930 bytes).

AJSHOST#1

Sets the name of the manager host (character string of up to 255 bytes) which has requested the execution of the job.

AJS_AJSCONF#1

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#1

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#1

Sets the job execution ID (character string of up to 10 bytes).

AJSEXECPID#1

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#1

Sets a logical host name for only a logical host.#2

JP1JobName#1

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#1

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#1

Sets the name of the user who has submitted the job (character string of up to 63 bytes).

JP1_USERNAME#1

Sets the name of the user who has submitted the job (character string of up to 63 bytes).

JP1UNCName#1

Sets the name of the agent host that is running the job (character string of up to 255 bytes).

JP1NBQSQueueName#1

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.

If an execution agent name (character string of up to 255 bytes) is specified for the execution agent in the detailed definition of the job, the execution agent name is set in place of the queue name in \\manager-host-name\execution-agent-name format.

If an execution agent group name (character string of up to 255 bytes) is specified for the execution agent in the detailed definition of the job, the execution agent group name is set in place of the queue name in \\manager-host-name\execution-agent-group-name format.

For a queueless job, this variable does not set anything.

JP1NBQSClientName (Windows only) #1

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#1

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

  1. The shell specified on the first line of the script file specified for the job

  2. The login shell defined in the password file of the user who executes the job

  3. /bin/sh

When Command statement is specified for a job that will be executed in a jobnet#3

  1. The shell specified on the first line of Command statement specified for the job

  2. The login shell defined in the password file of the user who executes the job

  3. /bin/sh

When the jpqjobsub command is used to execute the job

  1. The shell specified on the first line of the script file specified for the job

  2. The shell path name specified in the jpqjobsub command's -shl option

  3. The login shell defined in the execution user's password file

  4. /bin/sh

LANG (UNIX only)

Sets the LANG environment variable for use at the JP1/AJS3 startup.#5, #6 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 Failover Clustering 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)#1

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)#1

Sets /bin:/usr/bin.#4, #5

AJSQLManagerName (Windows only)#1

For queueless jobs only, sets the name of the manager host (character string of up to 255 bytes) which has requested the execution of the job.

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). For a flexible job, do not use any environment variables that begin with JP1, AJS, AJS2, or AS_ (case-insensitive).

  • The TZ environment variable is not set during job execution.

  • 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

This environment variable is not set for a flexible job.

#2
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.

#3

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.

#4

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.

#5

If the service to be executed is for Queueless Agent jobs, the environment variable value set when the queueless agent service starts will be set.

#6

For a flexible job, the environment variable value set when the JP1/AJS3 Autonomous Agent service was started will be set.

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.

For environment variables like TZ that are not set during job execution, set them as one of the options below. 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).

Cautionary note

In Windows, when a job is executed, system environment variables are enabled, but user environment variables are not. However, if the JP1/AJS3 service start account is changed from a system account to a user account, when a job is executed, the user environment variables for the JP1/AJS3 service start account are enabled.

In addition, when the system is configured as a cluster system with logical hosts, the Failover Clustering# reads the user environment variables at system startup. The user environment variables take effect in the JP1/AJS3 services started by the Failover Clustering on the logical hosts, and are also used at job execution.

In addition to the system environment variables, the environment variables set at OS startup are also read when JP1/AJS3 services are activated.

#

For clustering software other than Failover Clustering, see the software specifications.