EDIT macro #MAKEMAC EDIT macro #MAKEMAC Author: David McRitchie formatted on 1995/04/01 06:54 for assistance contact: D. McRitchie DMcRitchie@hotmail.com -------------------------------------------------------------------------------- macro NAME. #MAKEMAC users. PDF EDIT users particularly SCRIPT users type. Edit Macro resides in SYS1.TSOCLIST -------------------------------------------------------------------------------- #MAKEMAC Create REXX edit macro commands from list of edit commands -------------------------------------------------------------------------------- related REFORMAT -------------------------------------------------------------------------------- The MAIN PURPOSE of this macro is to convert a copy of the edit com- mands that you did to an edit macro so that you can repeat the same commands later. All cards are assumed to be edit commands. This macro add double quotes at beginning and end of each line so edit macro lines are gen- erated. Special provision has been made to cover edit-command so that they are repeated until they no longer give RC=0. If the next line is also an edit-command, you should check to see if the the two DO FOREVER loops should be combined. Provision is also made for :TS (text split) and :TF (text flow). A | in column one will be used as an escape to copy a REXX command or other line unchanged .e.g |DO|END. -------------------------------------------------------------------------------- ISREDIT #MAKEMAC (no operands) -------------------------------------------------------------------------------- Subject: Creating REXX execute macro from a list of edit commands TSO ----------- creating an EDIT MACRO quickly ------------- If you copy down the edit commands that want on a piece of paper as you enter them in actual use and then reenter all of the correct items into a dataset (PF24 RETRIEVE, can show some of them) you can convert them into an execute macro by invoking the macro #MAKEMAC. Your commands will be prefixed and suffixed by double quotes so that they will become EDIT commands in a REXX execute macro. Some special features A | in column 1 will copy over the card unchanged less the | . A & in column 1 (or elsewhere) will be preceded by DO FOREVER and followed by END Use of :TS will cause TSPLIT remainder Use of :TF will create TFLOW .ZCSR remainder Use of LABEL .xxx with no = sign will cause a label to be created at the .ZCSR location. e.g. "LABEL .ZCSR = .xxx 0" The following could be sample input, some modification will be re- quired afterwards. |"@strap listuser" sysvar('SYSUID') | /* or use @STRAP EXEC "list.of.LISTUSER.commands" */ | /* @STRAP will issue a TSO command and trap the output, append to c all 1 '1' ' ' x all |/* find incomplete phone numbers that continue on next line */ &f all p'phone$ ======= ' &:TF f all user= f all last-access= f all information= del x all .cc BEATTY1 BITTING BUCKTA CEVALLOS KENNEDY1 MARTIN PITTSON1 TESTA ZIN Example of source and text converted by #MAKEMAC |/* REXX -- REPROCESS output from LISTUSER xxxx */ |/* sandy Bounpane created LISTUSER xxxx */ |/* cards which could be used to populate an empty member */ |/* using ===> @STRAP exec 'data.set.name' */ |/* then ===> LISTCONN -- resides in is03.libr.clist*/ |/* This macro was created with the help of #MAKEMAC execute*/ f first p'=' c all 1 '1' ' ' |/*looking for incomplete phone numbers e.g. 555-451 */ &f 'phone$ ======= 'p |/* combine the following lines into above group*/ :tf c all 71 80 .zcsr .zcsr ' ' '' x 'phone: ' .zcsr .zcsr first c 'phone:' .zcsr .zcsr first nx 'phone: ' find last .zcsr .zcsr 'ª'p |/* combine the above lines into the forever group -- remove END*/ |end x all ' ' f phone: all c all last-a ' ------ last-a' f user= all f installation all del x all .zf .zl &c all 10 20 ' name=' ' name=' |/* also move owner= over */ &c all 38 48 ' owner=' ' owner=' x all ' ' f user= all sortg 17 80 .zf .zl |say "sortg completed" reset x '$'p all del nx all |say "del x completed" c all 3 'installation-data=' ' ' x all ' ' f user= all c all 40 80 p'ª' nx ' ' c all 41 ' ' '-' nx f user= all @icopy blank before nx entire f user= all f first p'=' |Do forever f 'user=' | if rc /= 0 then leave TFLOW .ZCSR c nx '- ---' '-----' x .zcsr .zcsr last-access=92. all |End x all 1 ' ' x all last-access=92. c all nx 100 ' ' '-------' LINE_AFTER .ZL = dataline ' ' |LINE_AFTER .ZL = dataline ""Processed by LASTCONN macro , | date('j') -- date('u') time('n') SYSVAR(sysuid)"""" -------------------------------------------------------------------------------- Page PFKEYS-1 SYSTECH NOTICE -- CLISTS /* REXX -- .................................................. */ Address "ISREDIT" "MACRO (TOKEN)" /* This edit macro was ....................................... */ /* created by #MAKEMAC macro from list of macro commands */ /* in card image form 92211 -- 1992/07/29 21:28:50 IS03 */ /* while editing IS03.LIBR.CLIST(LAST2) */ /* It is your responsibility to verify #MAKEMAC conversion. .. */ /* REXX -- REPROCESS output from LISTUSER xxxx */ /* sandy Bounpane created LISTUSER xxxx */ /* cards which could be used to populate an empty member */ /* using ===> @STRAP exec 'data.set.name' */ /* then ===> LISTCONN -- resides in is03.libr.clist*/ /* This macro was created with the help of #MAKEMAC execute*/ "f first p'=' " "c all 1 '1' ' ' " /*looking for incomplete phone numbers e.g. 555-451 */ Do forever "f 'phone$ ======= 'p " if rc /= 0 then leave /****** removed end per manual instruction ++++ */ /* combine the following lines into above group*/ "TFLOW .ZCSR " "c all 71 80 .zcsr .zcsr ' ' '' " "x 'phone: ' .zcsr .zcsr first " "c 'phone:' .zcsr .zcsr first nx 'phone: ' " "find last .zcsr .zcsr 'ª'p " /* combine the above lines into the forever group -- remove END*/ end "x all ' ' " "f phone: all " "c all last-a ' ------ last-a' " "f user= all " "f installation all " "del x all .zf .zl " Do forever "c all 10 20 ' name=' ' name=' " if rc /= 0 then leave End /* also move owner= over */ Do forever "c all 38 48 ' owner=' ' owner=' " if rc /= 0 then leave End "x all ' ' " "f user= all " "sortg 17 80 .zf .zl " say "sortg completed" "reset " "x '$'p all " "del nx all " say "del x completed" "c all 3 'installation-data=' ' ' " "x all ' ' " "f user= all " "c all 40 80 p'ª' nx ' ' " "c all 41 ' ' '-' nx " "f user= all " "@icopy blank before nx entire " "f user= all " "f first p'=' " Do forever " f 'user=' " if rc /= 0 then leave " TFLOW .ZCSR " " c nx '- ---' '-----' " " x .zcsr .zcsr last-access=92. all " End "x all 1 ' ' " "x all last-access=92. " "c all nx 100 ' ' '-------' " "LINE_AFTER .ZL = dataline ' ' " "LINE_AFTER .ZL = dataline ""Processed by LASTCONN macro " , date('j') -- date('u') time('n') SYSVAR(sysuid)"""" Another example similar to the previous No changes made to output, manual change would be required. label .b f first p'=' label .a f phone all nxnx after x p'$' all find last p'=' c 40 ' ' nx ' ' f phone all f last-a all del x all &c all 10 20 ' name=' ' name=' x 17 name= all &c all 38 48 ' owner=' ' owner=' sortg 17 80 .zf .zl x all f user= all @icopy blank before nx entire x all &f 'phone$ ======= 'p all &:tf c all 71 80 ' ' '' x 'phone: ' all c all 'phone:' nx 'phone: ' /* REXX -- .................................................. */ Address "ISREDIT" MACRO (TOKEN) /* This edit macro was ....................................... */ /* created by #MAKEMAC macro from list of macro commands */ /* in card image form 92211 -- 1992/07/29 20:37:06 IS03 */ /* while editing IS03.LIBR.CLIST(JUNK) */ /* It is your responsibility to verify #MAKEMAC conversion. .. */ "LABEL .ZCSR = .b 0" "f first p'=' " "LABEL .ZCSR = .a 0" "f phone all " "nxnx after " "x p'$' all " "find last p'=' " "c 40 ' ' nx ' ' " "f phone all " "f last-a all " "del x all " Do forever "c all 10 20 ' name=' ' name=' " if rc /= 0 then leave End "x 17 name= all " Do forever "c all 38 48 ' owner=' ' owner=' " if rc /= 0 then leave End "sortg 17 80 .zf .zl " "x all " "f user= all " "@icopy blank before nx entire " "x all " Do forever "f 'phone$ ======= 'p all " if rc /= 0 then leave End /* ...check for possibly combining prev/next do/end group ......*/ Do forever "TFLOW .ZCSR " if rc /= 0 then leave End "c all 71 80 ' ' '' " "x 'phone: ' all " "c all 'phone:' nx 'phone: ' " n #MAKEMAC on