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 requires the JV subsystem to be loaded. For more information on job variables refer to the “Job Variables” manual [5].
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 and must therefore correspond to the SDF data type <filename 1...54 without-gen-vers>.
A JV without catalog and/or user identification is completed according to common DMS rules:
If no user ID is given, the user ID of the current job (i.e. from the SET-LOGON-PARAMETERS command) is used.
If no catalog ID is given, the user's default pubset is used.
ERROR-REPORTING =
You can define if error handling is to be triggered when an error occurs or if the message code of the error message is to be stored in an S variable.
ERROR-REPORTING = *PROC-ERROR-MECHANISM
Error handling is to be triggered when an error occurs, see the section “Error handling”.
ERROR-REPORTING = *RETURN-FALSE
The result FALSE is to be output when an error occurs. No error message is output. The message code of the error message is written in the variable specified in ERROR-VARIABLE = ... .
ERROR-VARIABLE =
An S variable can be defined for the message code. The message code is only written in the variable when ERROR-REPORTING = *RETURN-FALSE was specified in the function call.
ERROR-VARIABLE = *NONE
No S variable is defined .
ERROR-VARIABLE = string_expression
Name of the S variable in which the message code of the error message is written. Note the following items:
If the variable name is specified directly, then it must be enclosed in quotes, otherwise the contents of the variable are interpreted as a variable name.
Data is only written in the S variable when an error occurs (result=FALSE) and ERROR-REPORTING=*RETURN-FALSE was specified. Examples of possible message codes: SDP0439, SDP0440 or DMSxxxx.
If an error occurs while writing to the S variable, then the corresponding error message is output to SYSOUT regardless of the value specified for ERROR-REPORTING, and the S variable does not contain a return value.
Result
TRUE
The job variable designated in the JV parameter is cataloged.
FALSE
The job variable designated in the JV parameter is not cataloged an error occurred during a call 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