Domain: | Job variables |
The IS-CATALOGED-JV( ) function checks whether a catalog entry exists for the specified job variable names, i.e. whether the specified job variable exists. This function can only be used if the JV subsystem has been loaded in the system. For more detailed information on job variables see the “Job Variables” manual [20].
Format
IS-CATALOGED-JV( ) IS-CAT-JV( ) |
JV = string_expression ,ERROR-REPORTING = *PROC-ERROR-MECHANISM / *RETURN-FALSE ,ERROR-VARIABLE = *NONE / string_expression |
Result type
BOOLEAN
Input parameters
JV = string_expression
Designates a job variable. When a JV name is specified directly it must be enclosed in quotes.
ERROR-REPORTING =
In the event of an error, you can define whether error processing is triggered or the message code is stored in an S variable.
ERROR-REPORTING = *PROC-ERROR-MECHANISM
In the event of an error, error processing is triggered (see section "Block-oriented error recovery").
ERROR-REPORTING = *RETURN-FALSE
In the event of an error, the result FALSE is output. An error message is not output. The message code of the error message is written to the variable specified in ERROR-VARIABLE = ... .
ERROR-VARIABLE =
An S variable can be defined for the message code. The message code is only written to the variable if in the function call ERROR-REPORTING=*RETURN-FALSE is specified in the function call.
ERROR-VARIABLE = *NONE
No S variable is specified.
ERROR-VARIABLE = string_expression
The name of the S variable where the message code of the error message is written. Note the following:
If the variable name is directly specified, it must be enclosed in quotes. Otherwise, the contents of the variable are interpreted as the variable name.
Message codes are only written to the S variable if an error occurs (result=FALSE) and ERROR-REPORTING=*RETURN-FALSE was specified. Example of possible error codes: SDP0439, SDP0440 or DMSxxxx.
If an error occurs when writing to the S variable, the corresponding error message is output to SYSOUT, regardless of the specification in ERROR-REPORTING and the S variable contains no return value.
Result
TRUE
The job variable designated in the JV parameter has been cataloged.
FALSE
The job variable designated in the JV parameter has not been cataloged or an error occurred when calling with ERROR-REPORTING=*RETURN-FALSE.
Error message
SDP0495 '(&00)' NOT A CORRECT JV NAME SDP1054 JOB VARIABLE ERROR: JVS ERROR CODE '(&00)' WHILE ACCESSING JOB VARIABLE '(&01)'. IN SYSTEM MODE: /HELP-MSG JVS(&00)
Example
/IF (IS-CATALOGED-JV(JV='PS')) /WRITE-TEXT 'EXISTS' /ELSE /WRITE-TEXT 'CREATE' /END-IF
Output:
CREATE