/* REXX test of command for 2.3.14 SearchFor */ /* CREATED by D.McRitchie, "The REXX Macros Toolbox", 1991/10/24 */ /* comparable edit macro is @search4 */ /* comparable tso rexx exec is SEARCH4 */ /* multiple search arguments must be separated by commas */ /* without intervening spaces unless part of search arg. */ /* e.g. */ /* ===> TSO SEARCH full.dsname 1a 1b,c2 d2 e2,'3f 3g 3h 3i' */ /* quotes are optional but dsname must be fully qualified */ /* ---------------------------------------------------------- */ /*********************************************************************/ /* Manual for ISPF/PDF Guide and Ref. V3R3 MVS -- SC34-4258-01 */ /*********************************************************************/ Parse arg token i= index(token," ") if i /= 0 then do; dsn = substr(token,1,I-1) dsn = strip(translate(dsn,' ',''''),'b') token = substr(token,I+1) end else do dsn = token token = '' end if dsn = '' then DSSFNDSN = ''; else DSSFNDSN = "'"dsn"(*)'" /* ---------------------------------------------------------- */ if token = '' then ADDRESS "ISPEXEC" "VPUT (DSSFNDSN)" else do /* conditional update of VPUT arguments */ parse var token zssfs1 ',' zssfs2 ',' zssfs3 ',' zssfs4 ',' , zssfs5 ',' zssfs6 ',' zssfs7 /* single imbedded quotes are invalid, even within double quotes*/ /* -- will not be tested for here, left to SEARCHFOR to tell you*/ do i = 1 to 7 /*interpret executes expression*/ x = "if zssfs"i" /= '' then if substr(zssfs"i",1,1) /= ''''" , " then do;j = index(zssfs"i",' ');if j/=0 then zssfs"i , " = ""'""zssfs"i"""'"";end" /* say x -- to debug*/ interpret x; /*change if any blank, unless begins with quote*/ end if zssfs2 = '' then zssfmult = 'NO'; else zssfmult = 'YES' Address "ISPEXEC" "VPUT (DSSFNDSN ZSSFMULT ZSSFS1 ZSSFS2 ", "ZSSFS3 ZSSFS4 ZSSFS5 ZSSFS6 ZSSFS7)" end Address "ISPEXEC" "SELECT PGM(ISRSFM)" /* OPT 2.3.14 Search*/ DSSFNDSN = '' Address "ISPEXEC" "VPUT DSSFNDSN"