To share information across jobs in a job net, pass it as a job net variable and use it on succeeding jobs. This allows for flexible job operations. For example, message event and file name information for which a job waits can be passed as job net variables, enabling processing for the succeeding job to be changed to suit specific requirements.
Flow for using job net variables
If you set a job net variable in a job definition, you can use the line with the format "<string>(NAME)=<string>(VALUE)" from the job output information as a job net variable.
In addition, specify a definition for the succeeding jobs in the same job net so that they use the job net variable. The succeeding jobs can use the job net variable to perform specific processing.
In jobs that will use job net variables, specify the portion to be replaced with a job net variable value at execution in the format "@job net variable name@". When the jobs are executed, that portion will automatically be replaced with the value of the specified job net variable and operations will continue.
The following figure illustrates the definition, operation, and result of jobs that set the job net variables, and jobs that use the job net variables when you define job net variables for a job in a job net.
Job net variables can be used between jobs within the same job net. They are shared by the jobs within a job net and can be handled individually for each job net. You can also use job net variables between the parent job net and the child job nets of a layered job net.
There are two types of job net variable:
Job net variables that can be obtained from job output information
This information is dynamically rewritten while the job net is running.
Job net variables automatically set by the system
This information contains predetermined variable names and variable values. It also contains variable parameters. This information cannot be rewritten while the job net is running.
Job net variables obtained from job output information
If a line with the format "<string>(NAME)=<string>(VALUE)" is output as the job execution result, you can replace the portion in the format "@job net variable name@" in the succeeding job with "<string>(VALUE)" before using the job. Job net variables that thus use variable information obtained from job execution results are explained below.
Job net variable names
The format of a job net variable name is as follows:
<job net variable prefix>.<string>(NAME) |
Example job net variable name and value
Definable strings
The following strings can be defined for the job net variable name and job net variable value:
Type | Definable string |
---|---|
Job net variable prefix | Alphanumeric string of up to 13 bytes |
Job net variable name | String of up to 50 bytes containing alphanumeric characters and underscores ("_") If the string exceeds 50 bytes excluding leading and trailing spaces and tabs, it is not treated as a job net variable. |
Job net variable value | String of 0 to 512 bytes (*1) |
*1: When defining a value for the job net variable, ensure that the definition
item that will replace "@variable name@" in the definition of the job to be
started does not contain any invalid characters or exceed the maximum string
length. If a replacement results in an invalid job definition, the job will
terminate abnormally without running.
Limit values of job net variables
Job nets can import up to 640 job net variables from job output information.
The upper limit on the number of job net variables that can be used by a layered job net is 640 for the parent job net and child job nets combined.
Job net variables automatically set by the system
The variable name of a job net variable automatically set by the system is fixed. The variable value is set specifically for each job net or job and does not change while the job net is running. The types of job net variable automatically set by the system are explained below.
Job net variables automatically set by the system
Variable name | Variable value |
---|---|
@.VPARAM@ | Variable parameter. This is variable information that can be specified each time a job net is started. If no variable parameter value has been set, this variable is replaced with a blank string. |
@.PROJECT@ | Name of the project in which the job to be executed is registered. |
@.JOBNET@ | Name of the job net in which the job to be executed is registered. |
@.JOBNAME@ | Job name if Job name was registered in job registration information. |
@.SUB_SYSTEM@ | [SE] |
@.MASTER_PROJECT@ | [SE] |
This section explains how to set job net variables by using a job.
Defining a job that sets job net variables
This section explains the steps required when creating and defining a job for setting job net variables.
Create a job (execution file)
Create a job that outputs the variables and associated values at execution in the format "<string>(NAME)=<string>(VALUE)"
Configure the settings in the Add/Change - Job window
Standard information tab
Clear Do not save standard/error output
If this check box is specified, job output information is not output and so no job net variables are set.
Detail information tab
Select Set the job output information "NAME=VALUE" in the job net variable
In Job net variable prefix, set a value that is unique to the job
Figure 4.47 Standard information tab of the Add/Change - Job window
Figure 4.48 Detail information tab of the Add/Change - Job window
Types of jobs that can be set for job net variables
Set job net variables using the strings described in "Definable strings".
Event wait jobs and some criterial jobs provided by Systemwalker Operation Manager output information in the format "<string>(NAME)=<string>(VALUE) ", which can be used for job net variables.
The types, variable names, and output values of these jobs are explained below. Information is output to standard output in the format "<variable name>=<output value>".
Wait for file job/file existence criterial job (chkfile/jobschchkfile command)
Variable name | Output value | Condition for output |
---|---|---|
CF_FILENAME | File name of the file that was changed (full path) | When any of the following is specified: Create (-fwait)/delete (-fdelete)/update (-fupdate)/change size (-fsize) |
CF_CHKTYPE | One of the following change types: | When any of the following is specified: Create (-fwait)/delete (-fdelete)/update (-fupdate)/change size (-fsize) |
CF_FILESIZE | File size (bytes) | When any of the following is specified: Create (-fwait)/update (-fupdate)/change size (-fsize) |
CF_FILEYEAR | File update year "yyyy" | When any of the following is specified: Create (-fwait)/update (-fupdate)/change size (-fsize) |
CF_FILEDATE | File update date "mmdd" | When any of the following is specified: Create (-fwait)/update (-fupdate)/change size (-fsize) |
CF_FILETIME | File update time "hhmm" | When any of the following is specified: Create (-fwait)/update (-fupdate)/change size (-fsize) |
Wait for message event job (jobschchkmsgevt command)
Variable name | Output value | Condition for output |
---|---|---|
CM_MSGEVENT | Name of the message event that was generated | This information is always output. |
CM_PRJNAME | Name of the project in which the message event was generated | When a project name is specified and a message event is generated |
CM_NETNAME | Name of the job net in which the message event was generated | When a job net name is specified and a message event is generated |
CM_VPARAM | Variable parameter specified when the message event was generated | When a variable parameter is specified and a message event is generated |
CM_EVLOGSRC | Source name of the event log defined in the message table | When a message event is generated by the message table definition |
CM_EVLOGEID | Event ID of the event log defined in the message table | When a message event is generated by the message table definition |
CM_MAILFILE | Mail file name of the message event generated upon mail receipt | When a message event is generated by mail receipt |
Check log file job (jobschchecklog command)
Variable name | Output value | Condition for output |
---|---|---|
CL_FILENAME | Name of the log file to be checked (specified in the -f option) | This information is not output when the -h or -v option is specified. |
CL_LOGCOUNT | Number of lines that match the conditions according to the check results | This information is not output when the -h or -v option is specified. |
CL_LOGTEXT | Content of the last line that matches the conditions according to the check results | This information is not output under the following conditions: |
Wait for time job (jobschchecktime command)
Variable name | Output value | Conditions for output |
---|---|---|
CT_WTIME | Specified wait time "hhmm" | This information is always output. |
CT_LTIME | Specified maximum wait time "hhmm" | When the -lt option is specified |
Wait until specified time job (jobschsleep command)
Variable name | Output value | Conditions for output |
---|---|---|
SL_SLEEPSEC | Specified wait time (seconds) | This information is always output |
Setting job net variables
If the job completion status is not "Completed" or "Pseudo-normal", no job net variables are set even if the job output information is output.
If, while a job net is running, the succeeding job sets the variable value of a job net variable with the same name as a job net variable already set by the preceding job, the job net variable value is overwritten.
If a job terminates abnormally and is restarted, the job net variable is replaced with the latest variable value.
A value specified for a job net variable can be used in a succeeding job. To do this, specify the job net variable name and define the succeeding job.
This section explains how to define jobs that use job net variables.
Defining jobs that use job net variables
In the Add/Change - Job window, define job net variables for the items you want to be replaced with job net variables when the job is executed.
Figure 4.49 Standard information tab of the Add/Change - Job window
Using a job net variable (@variable name@)
To use a job net variable, specify it in the format "@variable name@".
You can use the job net variable "@variable name@" for the items listed below. There is no limit on the number of items for which you can specify a variable. You can specify a job net variable for multiple items, or even specify multiple variables within one item.
Standard information tab
Command
Parameters
Directory
Request host
Queue name
Detail information tab
Effective user name
Standard output file
Standard error output file
Value of each environment variable (Value in the Set Environment Variables window)
You can use a job net variable together with a job definition variable.
You cannot use variables with the following jobs:
Interstage attribute job
PowerAIM attribute job
Normal attribute job
Job net variable values
Strings in the format "@variable name@" for which no job net variable name has been set are not replaced. They are treated as strings with the format "@variable name@".
If strings in the format "@variable name@" exist as job net variable values, they will not be treated as job net variables, job definition variables, or variable parameter variables but as normal strings. For example, if the value of the job net variable "JOB.a" is "aa @JOB.b@ cc" and the value of the job net variable "JOB.b" is "dd", replacement of "@JOB.a@" will result in "aa @JOB.b@ cc".
When defining a value for the job net variable, ensure that the definition item that will replace "@variable name@" in the definition of the job to be started does not contain any invalid characters or exceed the maximum string length. If a replacement results in an invalid job definition, the job will terminate abnormally without running.
Checking the job net variable value that is used
When jobs that use job net variables are executed, the job net variables are replaced with the variable values and operations continue. You can check the job net variable values that were actually substituted by opening the Previous log tab of the Monitor - Job window.
Figure 4.50 Previous log tab of the Monitor - Job window
This information was used as the job net variable when a job was executed. It is not displayed if the job net variable "@variable name@" is not used in the job definition.
Job net variables automatically set by the system are not always displayed.
Parameter information specified at variable parameter startup is displayed regardless of whether it is used in the job definition.
Information
Using job net variable criterial jobs
Use job net variable criterial jobs to check if the values of job net variables set at execution of the preceding job are the expected string and numeric values.
Job net variable criterial jobs can be used, for example, to allocate the processing of succeeding jobs based on the result of the check by the job net variable criterial job.
Job net variable criterial jobs can perform the following comparisons:
String comparison
Checks if the variable value matches the comparison string, or contains the comparison string
Numeric comparison
Checks if the variable value matches the specified value, or compares the size of the values
Numeric range comparison
Checks if the variable value is between two specified values
Note that the job net variable criterial jobs cannot be used to determine the job net variables automatically set by the system.
Information
Job net variable information file
Information about variables used during job execution and the result of importing the job net variables are stored in the job net variable information file. If the job net variables must be investigated because, for example, the job terminated abnormally, directly reference the job net variable information file. The following information can be checked in the job net variable information file:
Variables imported by each job from its job output information
Variables used by each job when it is run
List of variables in effect when the job net ends
The job net variable information file is updated as required while the job net is running. Do not reference the relevant job net variable information file while the job net is running.
Refer to the Systemwalker Operation Manager Reference Guide for information on the job net variable information file.