IEFSJSYM — JCL symbol service

Description

The IEFSJSYM JCL symbol service provides JCL symbol information from the submitted JCL to the program running under the submitted JCL. The JCL symbol service performs the following functions:
REQUEST=GETALL
Returns all of the JCL symbols and values for the job step in the area provided by the caller, and is mapped by the IEFSJSYD macro.
REQUEST=GETBYNAME
Returns symbol values for the symbol names provided by the caller by the SymListArray parameter.
To be visible to the program, the symbols must have been either exported prior to the job step or provided by the submitter. The symbols are returned without a leading ampersand character (&).
The following information is described once at the beginning of the IEFSJSYM macro description:
  • Environment
  • Programming requirements
  • Restrictions
  • Input register information
  • Output register information
  • Performance implications
Following the descriptions of the standard forms of all requests are:
  • Abend codes
  • Return and reason codes
  • Examples

Environment

The requirements for the caller are:

Environmental factor Requirement
Minimum authorization: Problem state with any PSW key
Dispatchable unit mode: Task
Cross memory mode: Any PASN, any HASN, any SASN
AMODE: 31-bit or 64-bit

If in AMODE 64, specify SYSSTATE AMODE64=YES before invoking this macro.

ASC mode: Primary or Access register (AR)
Interrupt status: Enabled for I/O and external interrupts
Locks: No locks held
Control parameters: Control parameters must be in the primary address space

Programming requirements

REQUEST=GETBYNAME
The caller must provide a list of valid symbol names. Invalid symbol names or symbols that were not exported will have a null symbol value and a symbol value length of zero. A return code of 4 will be returned to indicate that not all symbols were processed successfully.
IEFSJSYD macro
To map data returned by an IEFSJSYM request.

Restrictions

This service cannot be used reliably until the job has begun execution. Invoking the service before the first job step has started executing is not supported (for example, in exits such as IEFUJI that are invoked before the first job step has started executing).

When using the returned symbol values, the value of the symbol returned will be the last value set prior to or within the current job step (EXEC PGM=statement).

Input register information

There are no input register requirements for issuing the IEFSJSYM macro.

Output register information

When control returns to the caller, the GPRs contain:
Register
Contents
0
Reason code
1
Used as a work register by the system
2-13
Unchanged
14
Used as a work register by the system
15
Return code
When control returns to the caller, the ARs contain:
Register
Contents
0-1
Used as a work register by the system
2-13
Unchanged
14-15
Used as a work register by the system

Some callers depend on register contents remaining the same before and after issuing a service. If the system changes the contents of registers on which the caller depends, the caller must save them before issuing the service, and restore them after the system returns control.

Performance implications

None.

REQUEST= parameter of IEFSJSYM

The IEFSJSYM macro with the REQUEST parameter produces a DSECT that maps the format of the function routine input table.

Syntax

The syntax of the IEFSJSYM macro with REQUEST= is written as follows:

Syntax Description
   
   name name: symbol. Begin name in column 1.
   
One or more blanks must precede IEFSJSYM.
   
IEFSJSYM  
   
One or more blanks must follow IEFSJSYM.
   
REQUEST=GETALL Either REQUEST=GETALL or REQUEST=GETBYNAME is required.
REQUEST=GETBYNAME  
   ,SYMLISTARRAY=symlistarray Required for REQUEST=GETBYNAME only.
   ,NUMENTRIES=numentries Required for REQUEST=GETBYNAME only.
   
   ,SYMBAREA=symbarea  
   ,SYMBAREALEN=symbarealen  
   ,DIAGDATA=diagdata  
   
   ,RETCODE=retcode  
   ,RSNCODE=rsncode  
   
   ,PLISTVER=IMPLIED_VERSION IMPLIED_VERSION is the default value.
   ,PLISTVER=MAX  
   ,PLISTVER=0  
   
   ,MF=S S is the default value.
   ,MF=(L,list addr,0D) 0D is the default value.
   ,MF=(L,list addr,attr)  
   ,MF=(E,list addr,COMPLETE) COMPLETE is the default value.
   ,MF=(E,list addr,NOCHECK)  
   ,MF=(M,list addr,COMPLETE) COMPLETE is the default value.
   ,MF=(M,list addr,NOCHECK)  
   

Parameters

The parameters are explained as follows:

name
An optional symbol, starting in column 1, that is the name on the IEFSJSYM macro invocation. The name must conform to the rules for an ordinary assembler language symbol.
,DIAGDATA=diagdata
A required output parameter that specifies an area for service to return additional information. To code this parameter, specify an RS-type address, or address in register (2)-(12), of a 16-character field.
,MF=S
,MF=(L,list addr)
,MF=(L,list addr,attr)
,MF=(L,list addr,0D)
,MF=(E,list addr)
,MF=(E,list addr,COMPLETE)
,MF=(E,list addr,NOCHECK)
,MF=(M,list addr)
,MF=(M,list addr,COMPLETE)
,MF=(M,list addr,NOCHECK)
An optional input parameter that specifies the macro form.

Use MF=S to specify the standard form of the macro, which builds an inline parameter list and generates the macro invocation to transfer control to the service. MF=S is the default value.

Use MF=L to specify the list form of the macro. Use the list form together with the execute form of the macro for applications that require reentrant code. The list form defines an area of storage that the execute form uses to store the parameters. Only the PLISTVER parameter can be coded with the list form of the macro.

Use MF=E to specify the execute form of the macro. Use the execute form together with the list form of the macro for applications that require reentrant code. The execute form of the macro stores the parameters into the storage area defined by the list form, and generates the macro invocation to transfer control to the service.

Use MF=M together with the list and execute forms of the macro for service routines that need to provide different options according to user-provided input. Use the list form to define a storage area; use the modify form to set the appropriate options; then use the execute form to call the service.

IBM recommends that you use the modify and execute forms of IEFSJSYM in the following order:
  1. Use IEFSJSYM ...MF=(M,list-addr,COMPLETE) to specify appropriate parameters, including all required parameters.
  2. Use IEFSJSYM ... MF=(M,list-addr,NOCHECK) to specify the parameters that you want to change.
  3. Use IEFSJSYM ...MF=(E,list-addr,NOCHECK) to execute the macro.
,list addr
Specifies the name of a storage area to contain the parameters. For MF=S, MF=E, and MF=M, this can be an RS-type address or an address in register (1)-(12).
,attr
Specifies an optional 1-60 character input string which forces boundary alignment of the parameter list. Use a value of 0F to force the parameter list to a word boundary, or 0D to force the parameter list to a doubleword boundary. If you do not code attr, the system provides a value of 0D.
,COMPLETE
Specifies for the system to check for required parameters, and to supply default values for omitted optional parameters.
,NOCHECK
Specifies for the system to not check for required parameters, and to not supply default values for omitted optional parameters.
,NUMENTRIES=numentries
A required input parameter for REQUEST=GETBYNAME that specifies the number of entries in the CHAR(16) array pointed to by SYMLISTARRAY. To code this parameter, specify an RS-type address or address in register (2)-(12) of a halfword field, or specify a literal decimal value.
,PLISTVER=IMPLIED_VERSION
,PLISTVER=MAX
,PLISTVER=0
Specifies the version of the macro and determines which parameter list the system generates. PLISTVER is an optional input parameter on all forms of the macro, including the list form. When using this parameter, specify it on all macro forms used for a request and with the same value on all of the macro forms. To code this parameter, specify IMPLIED_VERSION, MAX, or 0, as follows:
IMPLIED_VERSION
Specifies the lowest version that allows all of the specified parameters to be processed. If you omit the PLISTVER parameter, IMPLIED_VERSION is the default.
MAX
Specifies to maximize the parameter list size. Because the supported maximum size can grow from release to release, the amount of storage that your program requires can also change. If your system can tolerate a size change, IBM recommends that you always specify PLISTVER=MAX on the list form of the macro. Specifying MAX ensures that the list-form parameter list is always long enough to hold all of the parameters that you might specify on the execute form, when both are assembled with the same level of the system. In this way, MAX ensures that the parameter list does not overwrite nearby storage.
0
Specifies to use the currently available parameters.
REQUEST=GETALL
REQUEST=GETBYNAME
A required parameter that specifies the JCL symbols to get. Use REQUEST=GETALL to get all symbol values that were exported. Use REQUEST=GETBYNAME to get specific named symbol values, given an array of symbol names.
,RETCODE=retcode
An optional output parameter into which the return code is copied from GPR 15. If you specify 15, GPR15, REG15, or R15 (within or without parentheses), the value will be left in GPR 15. To code this parameter, specify an RS-type address of a fullword field, or register (2)-(12) or (15), (GPR15), (REG15), or (R15).
,RSNCODE=rsncode
An optional output parameter into which the reason code is copied from GPR 0. If you specify 0, 00, GPR0, GPR00, REG0, REG00, or R0 (within or without parentheses), the value will be left in GPR 0. To code this parameter, specify an RS-type address of a fullword field, or register (0) or (2)-(12), (00), (GPR0), (GPR00), (REG0), (REG00), or (R0).
,SYMBAREALEN=symbarealen
A required input parameter that specifies the length of the SYMBAREA that is provided by the caller. To code this parameter, specify an RS-type address, or address in register (2)-(12) of a fullword field, or specify a literal decimal value.
,SYMLISTARRAY=symlistarray
A required input parameter for REQUEST=GETBYNAME that contains an array of up to 16 character entries, each of which contains a symbol name for which the symbol value is to be returned. Symbol names must be left-justified in the array entry, and if shorter than 16 characters, padded on the right with blank spaces.

A wildcard character (asterisk (*) to match 0 or more characters in the symbol name, or question mark (?) to match exactly one character) can used to specify a generic symbol name. Symbol names should not contain a leading ampersand character (&) or any special character other than a wildcard character.

IEFSJSYM returns a null value (SYDESYMVALUELEN=0) for entries that do not contain valid JCL symbol name; in addition, a return code of IEFSJSYMRC_Warn and a reason code of IEFSJSYMRsn_SymbolNameNotProcessed are set. To code this parameter, specify an RS-type address, or address in register (2)-(12), of a character field.

ABEND codes

None.

Return and reason codes

Table 1 contains return and reason codes, the equate symbols associated with each reason code, and the meaning and suggested action for each return and reason code.

Table 1. Return and reason codes for the IEFSJSYM macro
Return Code Decimal (hex) Reason Code Decimal (hex)

Equate Symbol for Reason Code
Meaning and Action

00 (00) None. Equate Symbol: IEFSJSYMRC_Ok

Meaning: The requested function was successfully completed.

Action: None.

04 (04) None. Equate Symbol: IEFSJSYMRC_Warn

Meaning: The values of some of the requested symbols could not be returned. Symbols without values are returned with null values and symbol value lengths of 0.

Action: Refer to the action for the individual reason code.

04 (04) 04 (04) Equate Symbol: IEFSJSYMRsn_SymbolNameNotProcessed

Meaning: For a GETBYNAME request, the values of some of the requested symbols could not be returned. This can occur if the symbol was not exported by the calling JCL, if the symbol was not SET after being exported, or if the symbol name input to IEFSJSYM did not follow JCL symbol name conventions. This only occurs for specific symbol names in the array, and not to symbol names that include wildcard characters. Symbols without values are returned with null values and symbol value lengths of 0.

Action: Check the submitted JCL to ensure that an EXPORT was done for the requested symbol and that the symbol was SET after the EXPORT statement.

04 (04) 08 (008) Equate Symbol: IEFSJSYMRsn_InsSuffSymSpace

Meaning: Insufficient space to return all of the symbols and values requested.

Action: Use the value returned in SYDALEN to obtain the storage required to fit all of the returned symbols, values and control information.

08 (08) None. Equate Symbol: IEFSJSYMRC_ParmError

Meaning: Invalid input parameter.

Action: Refer to the action for the individual reason code.

08 (08) 08 (04) Equate Symbol: IEFSJSYMrsn_ParmlistAddrInvalid

Meaning: IEFSJSYM could not use the parameter list provided.

Action: Verify that the address of the parameter list is valid and resides in virtual storage of the primary address space.

08 (08) 08 (08) Equate Symbol: IEFSJSYMrsn_SymbareaAddrInvalid

Meaning: IEFSJSYM could not use the output symbol area provided

Action: Verify that the address of the symbol area is valid and resides in virtual storage of the primary address space.

08 (08) 08 (00C) Equate Symbol: IEFSJSYMrsn_SymbListAddrInvalid

Meaning: IEFSJSYM could not use the input symbol list provided.

Action: Verify that the address of the data area is valid and resides in virtual storage of the primary address space.

08 08 08 (010) Equate Symbol: IEFSJSYMRsn_Mismatched_VersLen

Meaning: The length of the IEFSJSYM parameter list does not match the version number supplied.

Action: Ensure that the parameter list that was built matches the specified or default parameter list version.

08 08 08 (014) Equate Symbol: IEFSJSYMRsn_Unsupported_version

Meaning: The version of the parameter list is not supported with this level of the IEFSJSYM service.

Action: Correct the version and other parameters to match the system where the job was run, or run the job on a system that supports this version of IEFSJSYM.

08 (08) 08 (18) Equate Symbol: IEFSJSYMRsn_Unsupported_Function

Meaning: The request was for a function that is not supported with this level of the IEFSJSYM service.

Action: Choose a function that is supported on this level of IEFSJSYM service, or request this function on a system that supports it.

0C (0C) None. Equate Symbol: IEFSJSYMRC_EnvError

Meaning: Environmental Error

Action: Refer to the action for the individual reason code.

0C (0C) 0C (04) Equate Symbol: IEFSJSYMRsn_InsSuffHdSpace

Meaning: Insufficient space to return the header (SYDHDR) portion of the data area.

Action: Refer to the mapping macro IEFSJSYD and pass an area at least as large as the DSECT SYDHDR.

0C (0C) 0C (08) Equate Symbol: IEFSJSYMRsn_StorageNotObtained

Meaning: Failed to obtain above the bar storage via IARV64. The length of the storage requested is based on the size of the caller's SYMBAREA and SYMLISTARRAY size.

Action: Check the SYMBAREALEN specification. If SYMBAREALEN is coded as an extremely large number, try reducing the SYMBAREALEN to a size that is comparable to the number of symbols requested.

0C (0C) 0C (0C) Equate Symbol: IEFSJSYMRsn_IncorrectExecEnv

Meaning: A proper execution environment does not exist for the service.

Action: Verify that the program meets the requirements described previously. The returned DIAGDATA value will contain information that identifies the problem.

0C (0C) 0C (010) Equate Symbol: IEFSJSYMRsn_UnexpectedSjfResponse

Meaning: Underlying JCL services invoked by the service returned with a unexpected return and reason codes. IEFSJSYM might have been invoked before the job execution environment was established, or after the job execution environment had ended.

Action: Verify that the program is running under a batch program environment. The returned DIAGDATA value contains information, such as the JCL service and return and reason codes, to diagnose the error.

10 (10) None. Equate Symbol: IEFSJSYMRC_IntError

Meaning: Unexpected internal error.

Action: Report the problem to the system programmer.

Example

SJSYM_RC     DS   F
SJSYM_RSN    DS   F
SJDIAG       DS   4F
SYMBOLS      DS   0D
S1           DC   C'DSN     '
S2           DC   C'VOL     '
S3           DC   C'UNIT    '
SYMBOLAREA   DS   64F
    IEFSJSYM SYMLISTARRAY=SYMBOLS,NUMENTRIES=3,SYMBAREA=SYMBOLAREA,
           SYMBAREALEN=256,DIAGDATA=SJDIAG
or
    IEFSJSYM REQUEST=GETALL,SYMBAREA=SYMBOLAREA,SYMBAREALEN=256,
           RETCODE=SJSYM_RC,RSNCODE=SJSYM_RSN,DIAGDATA=SJDIAG