Why invoke ISPF multiple times? Invoke it once, with an ISPF macro to do the heavy lifting.
-- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Discussion List <[email protected]> on behalf of Dyck, Lionel B. (RavenTek) <[email protected]> Sent: Monday, June 25, 2018 7:34 AM To: [email protected] Subject: Re: [EXTERNAL] AW: ICEGENER to the rescue again? Another approach is to run an exec that uses listd to get all the members and then invoke ispf edit with a macro for each member - that macro could then do a REN,UNNUM, and then SAVE and END, which will clear out columns 73-80. Here is my exec that will invoke an edit macro on all members of a PDS with a sample edit macro after that will do what you want: /* --------------------- rexx procedure ---------------------- * * Name: DoAll * * * * Function: This rexx exec will process the specified * * ispf edit macro against every member of the * * specified partitioned dataset. * * * * Only standard system services are used. The * * LISTD TSO command with the MEMBERS keyword * * is used to extract the member names. * * * * Syntax: %DoAll dsname edit-macro * * * * Sample Edit Macro to change SYS1 to SYS2 * * * rexx exec chsys1t2 (change sys1 to sys2) * * * (the / was removed from the above line to avoid syntax * * errors in this exec). * * Address ISREDIT * * "MACRO" * * "CHANGE 'DSN=SYS1.' 'DSN=SYS2.' ALL" * * "SAVE" * * "END" * * * * Sample Execution: %Doall 'sys2.testjcl' chsys1t2 * * * * Author: Lionel B. Dyck * * Internet: [email protected] * * * * History: 11/30/90 - created * * * * ------------------------------------------------------------- */ arg dsn exec if left(dsn,1) <> "'" then do dsn = sysvar(syspref)"."dsn end else do dsn = substr(dsn,2,length(dsn)-2) end x = outtrap("lm.","*") "LISTD" "'"dsn"'" "MEMBERS" x = outtrap("off") do i = 1 to lm.0 if lm.i = "--MEMBERS--" then leave end domem: do j = i+1 to lm.0 parse value lm.j with mem extra Address ISPEXEC "EDIT DATASET('"dsn"("mem")')" , "MACRO("exec")" end /* REXX */ /* FIXNUM Edit Macro */ Address ISREdit 'Macro' 'REN' 'UNNUM' 'Save' 'End' -------------------------------------------------------------------------- Lionel B. Dyck (Contractor) <sdg>< Mainframe Systems Programmer - RavenTek Solution Partners -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Peter Hunkeler Sent: Monday, June 25, 2018 6:13 AM To: [email protected] Subject: [EXTERNAL] AW: ICEGENER to the rescue again? Please excuse the bad formatting. Trying Again. Are you familiar with REXX? If so, here is how you could do this: In a REXX:- LISTDS to get a list of the members in the PDS.- ALLOCATE an new PDS for the changed members.- FREE the output dsn. - In a loop for each member: -- ALLOCATE the input dsn(member_nn)-- EXECIO to read the member into input stem. -- FREE the input dsn -- in a loop move each reccord from input to output stem, but only first 72 positions --- end of inner loop -- ALLOCATE the output dsn(member_nn) -- EXECIO to write the changed data back into the member. -- FREE the output dsn -- end of outer loop Not the most efficient way, but if this is a one-time job, it probably doesn't matter. -- Peter Hunkeler ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
