Overriding the data set list from a REXX exec
The ISPF variable, CRZDSNX, can be populated with one or more data set names separated by commas and stored in the ISPF SHARED variable pool to direct any nested invocation of enhanced find to use the data set names specified in the variable.
Example
In the following example, a REXX exec produces an ISPF member list. If enhanced find is invoked from the member list,
then the DSNs field is populated with the data set names found in CRZDSNX.Figure 1. Example providing data set names for enhanced find
/* REXX Example providing data set names for enhanced find */
mydsns = "'myhlq.EXEC' 'myhlq.TESTPDS' 'myhlq.TESTPDSE'"
CRZDSNX = "myhlq.EXEC,myhlq.TESTPDS,myhlq.TESTPDSE" /* enhanced find dsns */
ADDRESS TSO
"ALLOC FI(MYDD) DA("mydsns") SHR REUSE"
ADDRESS ISPEXEC
"VPUT (CRZDSNX) SHARED"
"LMINIT DATAID(DID) DDNAME(MYDD) ENQ(SHRW)"
"LMOPEN DATAID("DID")"
"MEMLIST DATAID("DID") CONFIRM(YES)"
"LMFREE DATAID("DID")"
CRZDSNX = " " /* clear variable */
"VPUT (CRZDSNX) SHARED"
ADDRESS TSO
"FREE FI(MYDD)"
Note: We clear CRZDSNX before the REXX exec finishes as enhanced find
will continue to use these values if they are present in the ISPF shared pool.