Did you know that there is now an Application Program Interface available in r11 to allow access to MVS Static System Symbols?
The API is named $CAPKBIF and it is documented in Chapter 7 of the Unicenter NetMaster, NetSpy, and SOLVE Network Control Language Reference.
For example, the following NCL could be used to display all Static System Symbols:
&CALL PROC=$CAPKBIF PARMS=(PLEXSYM,,COUNT)
&Count = &$CAVALUE
&WRITE Number of PLEXSYM variables = &Count
&SYM =
&I = 1
&DOWHILE &I LE &Count
&CALL PROC=$CAPKBIF PARMS=(PLEXSYM,&SYM,NEXT)
&SYM = &$CAVALUE
&CALL PROC=$CAPKBIF PARMS=(PLEXSYM,&SYM,VALUE)
&WRITE &I &SYM=&$CAVALUE
&I = &I + 1
&DOEND
The following is an example of the output produced:
Number of PLEXSYM variables = 11
Question: What if I only want to display one static system symbol?
Answer: A program like the following could be used to display one particular system symbol.
&CALL PROC=$CAPKBIF PARMS=(PLEXSYM,&1,VALUE)
&IF .&$CAVALUE NE . &THEN +
&WRITE TERM=YES LOG=NO DATA=The symbol for &1 is &$CAVALUE
&ELSE +
&WRITE TERM=YES LOG=NO DATA=No symbol found for &1
It could be invoked with the name of the symbol you wanted to display.
For instance, if the program is called PLEXSYM and PLEXSYM SYSNAME is entered, the following would be returned:
The symbol for SYSNAME is <SysName>
If SYSNAME is not found, the following would be returned:
No symbol found for SYSNAME