9.195 PUT_SYSTEM_VARIABLE
Þ Note: Built-In Function Rules.
Creates / amends a system variable. If the system variable name specified does not already exist the system variable is added, if it does exist the system variable definition is updated with the new details.
Þ This is a Specialized Built-In Function for use in a Development Environment only.
For use with
|
Arguments
|
Return Values
|
Example
A small program to allow the creation / amendment of system variables. The user is requested to fill in the system variable details and a message based on the return code notifies if the operation was successful.
GROUP_BY NAME(#SYSVAR) FIELDS(#SYSNAM #SYSDES #SYSSOD #SYSTYP #SYSLEN #SYSDEC #SYSPGM #PGMTYP #ACCESS)
********* Set some defaults
CHANGE #SYSNAM *NULL
CHANGE #SYSDES 'NULL VALUE'
CHANGE #SYSSOD 'DYNAMIC'
CHANGE #SYSTYP 'ALPHA '
CHANGE #SYSLEN 1
CHANGE #SYSDEC 0
CHANGE #SYSPGM 'SVPGM'
CHANGE #PGMTYP 'FUN'
CHANGE #ACCESS 'NORMAL'
********* Request System variable details
REQUEST FIELDS(#SYSVAR)
*********
USE BUILTIN(PUT_SYSTEM_VARIABLE) WITH_ARGS(#SYSNAM #SYSDES #SYSSOD #SYSTYP #SYSLEN #SYSDEC #SYSPGM #PGMTYP #ACCESS) TO_GET(#RETCOD)
********** Inform user of success / failure
IF '#RETCOD *EQ OK'
MESSAGE MSGF(SYSMSGS) MSGID(SYS0023) MSGDTA(#SYSNAM)
ELSE
MESSAGE MSGF(SYSMSGS) MSGID(SYS0024) MSGDTA(#SYSNAM)
* < ------- Handle any errors ------- >
ENDIF