Note: Built-In Function Rules Usage Options
Retrieves a list of system variables, their descriptions, programs and program types and returns them to the calling RDML function in a variable length working list.
This is a Specialized Built-In Function for use in a Development Environment only.
Arguments
|
Return Values
|
Example
A user wants to print a list of all system variables.
DEF_LIST NAME(#VARLST) FIELDS(#VARNAM #VARDES #VARPGM #VARTYP #SPARE)
TYPE(*WORKING) ENTRYS(1000)
********** -Define the report layout-
DEF_REPORT PRT_FILE(QSYSPRT)
DEF_HEAD NAME(#HEAD01) FIELDS(#TEXT #PAGE . . . )
DEF_LINE NAME(#VARPRT) FIELDS(#VARNAM #VARDES #VARPGM #VARTYP)
********** -Set start system variable to blanks-
CHANGE FIELD(#STRVAR) TO(*BLANKS)
********** -Get list of system variables-
USE BUILTIN(GET_SYSVAR_LIST) WITH_ARGS(#STRVAR) TO_GET(#VARLST #LAST #RETCOD)
********** -If return code is OK then process list-
IF COND('#RETCOD *EQ OK')
SELECTLIST NAMED(#VARLST)
********** -Print system variables-
PRINT LINE(#VARPRT)
ENDSELECT
********** -Otherwise issue an error-
ELSE
MESSAGE MSGTXT('An error has occurred. Report not produced.')
ENDIF
********** -Close printer file-
ENDPRINT