sysvar - Display static system symbols

Format

  • sysvar var
  • sysvar 'var(start[:length])'

Description

The sysvar command allows users to obtain substitution text for system variables that are defined in the IEASYMxx member of SYS1.PARMLIB or in the system IPL parameters. The substitution text is printed to standard output (stdout). The substitution text can be used to substitute system variables in shell variables.

Substrings of system variables can be accessed by specifying the starting position and, optionally, the number of characters, which are enclosed in parentheses and separated by a colon. When length is not specified, sysvar 'var(start)' only prints the character in position start. For example, if the system symbol SYSNAME is assigned the substitution text SYS1A, sysvar 'SYSNAME(4)' will print 1.

Notes:
  1. The name of the system symbol must be specified in uppercase letters.
  2. Quoting or escaping must be applied if substring notation is used or if the symbol contains other special characters that are recognized by the shell.
  3. Refer to z/OS MVS Initialization and Tuning Reference for more information about system symbols and sysvar 'var(start[:length])'.

Examples

  1. Assuming that the system symbol is defined as SYSA1:
    system_name=$(sysvar SYSNAME)                                           
    echo $system_name                                                       
    ==> SYSA1                                                               
                                                                            
    system_name_short=$(sysvar 'SYSNAME(4:2)')                              
    echo $system_name_short                                                 
    ==> A1
    

Exit values

0
Successful completion.
1
Failure because var is not a valid system variable.
2
Failure because no var was specified.