4.3.1 Variables used for the definition of service linkage job information
For a service linkage job, you can define and use information that changes with each job execution as variables.
- Organization of this subsection
(1) Types of variables
When defining service linkage job information, you can define and use the following items as variables. For details on specific locations where variables are defined and on definition items for which variables can be used, see 7. Operation.
-
Variables that store the values specified in custom job definitions
-
Variables that store environment variables of the service linkage job execution environment
In JP1/AJS3, you can also store the environment variables that are set at job execution in environment variables of the service linkage job execution environment. For details about environment variables that are set at job execution, see the descriptions of environment variables that are set when jobs are executed from JP1/AJS3 in the JP1/Automatic Job Management System 3 Command Reference.
-
Variables reserved by the system and available by default
Variables that are automatically set when a service linkage job is executed are variables reserved by the system and available by default.
Variable name
Description
?CSASUUID?
UUID acquired when the service linkage job started
?CSASSTARTDAY?
System date when the service linkage job started
?CSASSTARTTIME?
System time when the service linkage job started
-
Variables that store the results of the standard output of the executed command lines
-
Variables that store the values of authentication information
(2) Format of variable names
The format of variable names used for service linkage jobs is ?CSAany-character-string?.
For details about the format that can be specified for service linkage job information, see 7. Operation.
(3) How to use variables
When you reference variables in the definition items of the service linkage job information, how to use variables depends on the type of the variable.
-
Variables that store the values specified in custom job definitions
-
Variables that store environment variables of the service linkage job execution environment
-
Variables that are reserved by the system and available by default
-
Variables that store the values of authentication information
Specify the variable name as is in the format of ?CSAany-character-string?.
-
Variables that store the results of the standard output of the executed command lines
Specify in the format of ?CSAany-character-string[any-number]?. This form of reference is called array notation. The specification method for any-number differs depending on whether you want to reference a specific line or all lines. The following describes the specification methods for each case.
- Important
-
-
When an undefined variable is specified, the value obtained by referencing the variable becomes an empty string.
-
When a variable is specified in the ?CSAany-character-string? format, it is regarded as an undefined variable, and the value obtained by referencing the variable becomes an empty string.
-
- When referencing a specific line
-
Specify an integer value for any-number that is equal to the line number in the standard output result minus 1. For example, to reference the first line of the standard output result, specify ?CSAany-character-string[0]?. To reference the 15th line, specify ?CSAany-character-string[14]?. Do not add leading zeros to the number.
- Important
-
When the value specified for any-number in ?CSAany-character-string[any-number]? is invalid, it is regarded as an undefined variable, and the value obtained by referencing the variable becomes an empty string.
Specifying a line number that does not exist in the standard output result is also considered an invalid value. For example, if the standard output result contains 20 lines, the specifiable range for any-number is from 0 to 19. In this case, specifying 25 for any-number would be invalid because it is outside the specifiable range.
- When referencing all lines
-
Specify ?CSAany-character-string[*]?, using an asterisk (*) for any-number. Each line of the standard output result is concatenated using a line feed code (ASCII code 0A in hexadecimal). Note that when the result obtained by referencing the variable is output to a file via Job standard output settings or Job standard error output settings, the output line feed code will follow the default line feed code of the OS running the service linkage job.
- Important
-
-
This specification method should be used only in Job standard output settings and Job standard error output settings within the execution definitions. If it is used in the areas listed below, the value obtained by referencing the variable will include a line feed code, which may cause the command execution or judgment to behave unexpectedly. In these areas, use the ?CSAany-character-string[line-number-1]? format instead.
- Common environment variables for command execution
- Command line
- Environment variables at time of command execution
- Value of the processing normal end condition
- Value of the retry condition for the processing continuation conditions
-
When using this specification, be aware of the size of the command's standard output stored in this variable. For guidance on size limits, see 5.3 Notes on execution of service linkage jobs.
-
This specification method is valid only when the execution host of the service linkage job is running either JP1/AJS3 - Manager or JP1/AJS3 - Agent version 13-50 or later. In versions earlier than 13-50, specifying an asterisk (*) for any-number will be regarded as invalid value.
-
(4) Resolution of variables
The value of a variable is resolved when the service linkage job is executed. Note that if the variable is undefined# or if the value of any-number is invalid when referencing the result of standard output, the variable portion is resolved as an empty character string.
The value of a variable is resolved when the service linkage job is executed. In the following cases, the variable part will be resolved as an empty string:
-
Referencing an undefined variable#
-
Referencing a variable that stores the standard output results before executing the command line
-
Referencing a variable that stores the standard output results when the command line is not executed due to judgment conditions
-
Using an invalid value for any-number when referencing the standard output results
- #
-
Control characters included in the user-defined string portion of ?CSAany-character-string? are also treated as variables.
As described in 7.1.13 Notes on Web GUI, you can register definitions that reference variables containing certain control characters (such as 0A(LF)). However, these cannot be defined as source variables, so they will be resolved as empty strings.
Therefore, when making definitions that include control characters, be careful not to unintentionally reference variables that contain control characters in your definitions.