9.111 GET_SYSVAR_LIST

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

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Positioning system variable. The returned list starts with the first system variable whose name is greater than the value passed in this argument.

1

20



Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

L

Req

Working list to contain system variable information.

List must not be more than:
32767 entries in Windows
9999 entries on IBM i.

The calling RDML function must provide a working list with an aggregate entry length of exactly 80 bytes.

Each returned list entry is formatted as follows:

From - To   Description

1 - 20   System variable name
21 - 60   System variable description
61 - 70   System variable program

71 - 73   Program type

74 - 80   << for future expansion >>

80

80



2

A

Opt

Last system variable in list. Typically this value is used as the positioning argument on subsequent calls to this Built-In Function.

1

20



3

A

Opt

Return code.

OK = list returned partially or completely filled with system variable details.  No more system variables exist beyond those returned in the list.

OV = list returned completely filled, but more system variables than could fit in the list exist. Typically used to indicate "more" system variables in page at  a time style list displays

NR = list was returned empty. Last system variable in the list is returned as blanks.

2

2



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