/* REXX PREVNAME In a PDS2SEQ backup file, some of whose lines are shown, find for each the prior ./ line showing the membername. Modification History 20250708 fxc collect members in CNTL(FIXLIST); 20250812 fxc SPACEOUT; add stats to FIXLIST; reset stats after EDIT; MONITOR if in trace; 20250920 fxc only write to CNTL if SAVE; */ address ISREDIT "MACRO (opts)" if rc = 20 then do /* ISREDIT not available */ address TSO parse source . . exec_name . ex_nam = Left(exec_name,8) /* predictable size */ helpmsg = ex_nam "is an EDIT macro" say helpmsg end upper opts parse var opts parms "((" opts opts = Strip( opts,'T','5d'x ) /* yes we want no bananas */ parse value "0" with sw. tv parse var opts "TRACE" tv . parse value tv "N" with tv . rc = Trace( 'O' ) ; rc = Trace( tv ) sw.0Save = WordPos( "SAVE",parms ) > 0 /* only write to CNTL if SAVE */ "F P'^' LAST NX " /* last shown line */ do forever "F ./ 1 PREV " /* locate its member */ if rc > 0 then leave /* all done */ "F P'^' PREV NX " /* get the next up */ if rc > 0 then leave end /* forever */ /* All the ./ lines are shown for the candidate lines. */ rc = Trace( 'O' ) ; rc = Trace( tv ) if trace() <> 'N' then option = " (( MONITOR" if sw.0Save = 0 then exit call L_BUILD_LIST /* -*/ call Z_EPILOG /* -*/ exit /*@ PREVNAME */ /* All the ./ lines are shown for the candidate lines. Build the list of membernames. . ----------------------------------------------------------------- */ L_BUILD_LIST: /*@ */ address ISREDIT parse value '' with mbrlist "F './' 1 FIRST NX " do forever if rc > 0 then leave /* end of the line */ "(txt) = LINE .zcsr " parse var txt '=' mbr . mbrlist = mbrlist mbr "F './' 1 NEXT NX " end /* forever */ return /*@ L_BUILD_LIST */ /* L_BUILD_LIST has created . Reshape into blocks that will be stored in .CNTL. . ----------------------------------------------------------------- */ Z_EPILOG: /*@ */ address TSO z_tv = trace() /* what setting at entry ? */ parse value '' with, zlc4date zlm4date zlmtime zlcnorc zlinorc, zlvers zlmod zlmnorc "NEWSTACK" msglim = 72 parse value '' with slug do Words( mbrlist ) rc = Trace( "O" ) parse var mbrlist mbr mbrlist rc = trace( z_tv ) if Length( Strip( slug mbr ) ) > msglim then do queue Strip( slug ) slug = '' end slug = slug Left( mbr,11 ) end /* mbrlist */ queue Strip( slug ) /* whatever is left */ rc = Trace( "O" ) rc = trace( tv ) push " Routines that need ....." zlcnorc = queued() /* current size */ "ALLOC FI( @TMP ) DA( CNTL(FIXLIST) ) SHR REU " "EXECIO" queued() "DISKW @TMP ( FINIS " "DELSTACK" "FREE FI( @TMP ) " parse value zlinorc zlcnorc with zlinorc . parse value zlmnorc zlcnorc with zlmnorc . zlc4date = Translate( 'CcYy/Mm/Dd',Date( 'S' ),'CcYyMmDd' ) parse value '01' with zlvers . parse value '01' with zlmod . parse value Left( Time(),5 ) with zlmtime . parse value zlc4date with zlm4date . "UPOE FIXLIST CNTL " zlvers zlmod zlc4date zlm4date, zlmtime zlcnorc zlinorc zlmnorc "PREVNAME", option address ISPEXEC "EDIT DATASET( CNTL(FIXLIST) ) " "DIRSTATS CNTL FIXLIST " option pull mbr zlvers '.' zlmod crdate chdate zlmtime zlcnorc, zlinorc zlmnorc . zlc4date = Translate( 'CcYy/Mm/Dd',crdate,'CcYyMmDd' ) zlm4date = Translate( 'CcYy/Mm/Dd',chdate,'CcYyMmDd' ) "UPOE FIXLIST CNTL " zlvers zlmod zlc4date zlm4date, zlmtime zlcnorc zlinorc zlmnorc "PREVNAME", option return /*@ Z_EPILOG */