Function VSAM009: Generic Alphanumeric System Variable Evaluator

LANSA

Function VSAM009: Generic Alphanumeric System Variable Evaluator
Name: VSAM009

Description: The following RDML function can be used as a generic alphanumeric system variable evaluation function for any alpha numeric system variable defined by S_159FSV.
FUNCTION OPTIONS(*NOMESSAGES *HEAVYUSAGE *DIRECT *ALP_SYSTEM_VARIABLE);
DEFINE FIELD(#SYSVARFIL) TYPE(*CHAR) LENGTH(100);
DEFINE FIELD(#RE_ENTRY) TYPE(*CHAR) LENGTH(1);
DEFINE FIELD(#RETCODE) TYPE(*CHAR) LENGTH(2);
DEFINE FIELD(#USEVAR$NM) REFFLD(#SYSVAR$NM);
DEFINE FIELD(#USEVAR$NV) REFFLD(#SYSVAR$NV);
DEFINE FIELD(#USEVAR$AV) LENGTH(200) REFFLD(#SYSVAR$AV);
DEF_LIST NAME(#VARLIST) FIELDS(#USEVAR$NM #STD_CODEL #USEVAR$NV #USEVAR$AV) TYPE(*WORKING) ENTRYS(9999);
**********;
IF COND('#RE_ENTRY *NE Y');
USE BUILTIN(TCONCAT) WITH_ARGS(*PART_DIR_EXECUTE VSAM008.DAT) TO_GET(#SYSVARFIL);
USE BUILTIN(TRANSFORM_FILE) WITH_ARGS(#VARLIST #SYSVARFIL T) TO_GET(#RETCODE);
CHANGE FIELD(#RE_ENTRY) TO(Y);
ENDIF;
CHANGE FIELD(#USEVAR$AV) TO(*BLANKS);
LOC_ENTRY IN_LIST(#VARLIST) WHERE('(#sysvar$nm = #usevar$nm) *and (#STD_CODEL = TRUE)');
CHANGE FIELD(#SYSVAR$AV) TO(#USEVAR$AV);
RETURN;