/* REXX */ /* */ /* AUTHOR: Mark Zelden */ /* Last Updated 05/31/2001 */ /* */ /***************************************************************/ /* */ /* This REXX exec can be used to process an ISPF EDIT Macro */ /* against every member of a PDS. */ /* */ /***************************************************************/ /* Command syntax: */ /* */ /* TSO %EDMACALL data_set_name macro_name */ /* */ /* If data_set_name is not enclosed in quotes, then the */ /* TSO PREFIX (normally the USERID) will be added to the */ /* beginning of the data set name. */ /* */ /***************************************************************/ /* Sample EDIT Macro and EDMACALL execution: */ /* */ /* CHGSYS Edit Macro */ /* */ /* /* rexx EDIT Macro to change "SYSA." to "SYSB." */ */ /* Address ISREDIT */ /* "MACRO" */ /* "CHANGE 'SYSA.' 'SYSB.' ALL" */ /* "SAVE" */ /* "END" */ /* */ /* EDMACALL Execution */ /* */ /* TSO %EDMACALL 'TEST.PROCLIB' CHGSYS */ /* */ /***************************************************************/ Arg DSN MACNAME . If MACNAME = '' then do /* no macro name parm given */ Say 'ERROR - EDIT MACRO name not specified' /* issue error msg */ Exit 12 /* exit RC=12 */ End If Pos("'",DSN) = 0 & SYSVAR(SYSPREF) <> '' then , /* if no quotes */ DSN = SYSVAR(SYSPREF) || '.' || DSN /* and PREF not null, add it */ Else DSN = Strip(Translate(DSN,"","'")) /* remove quotes if used */ CHKLIB = SYSDSN("'"DSN"'") /* see if data set exists */ If CHKLIB <> 'OK' then do /* data set not found */ Say 'ERROR -' dsn 'not found. Check name and quotes.' /* issue msg*/ Exit 12 /* exit RC=12 */ End junk = outtrap('MBR.') /* capture output to MBR. stem */ "LISTD '" || dsn || "' MEMBERS" /* issue LISTD cmd against PDS */ junk = outtrap('off') /* stop capturing output */ Do I = 1 to MBR.0 /* loop to get past vol info */ If MBR.I = "--MEMBERS--" then leave /* if member section, exit loop*/ End If I = MBR.0 then do /* no members in PDS */ Say 'ERROR - No MEMBERS found in' dsn'.' /* issue error msg */ Exit 12 /* exit RC=12 */ End Say 'Processing' MBR.0 - I 'members ...' Do J = I+1 to MBR.0 /* loop to execute edit macro */ Parse var MBR.J MACMEM . /* get rid of alias info */ Address ISPEXEC "EDIT DATASET('" || dsn || "(" || macmem || ")')" , "MACRO("macname")" End Say 'Processing complete!' Exit 0