Edit macro @ICOPY Edit macro @ICOPY Author: David McRitchie formatted on 1995/04/01 06:54 for assistance contact: D. McRitchie DMcRitchie@hotmail.com -------------------------------------------------------------------------------- Macro name. @ICOPY users. PDF EDIT users type. Edit Macro resides in SYS1.TSOCLIST, and in IS03.SPF2.MACROS for use on SPF/PC -------------------------------------------------------------------------------- @ICOPY Interleaved COPY facility -------------------------------------------------------------------------------- related EDIT command COPY related EDIT block line command COPY (C) (CC) related EDIT block line command COPY (R) (RR) related copy junk after .zl;c all #1# 'new-string' <-- repeat with differ ent strings related @DIR using the PATTERN(member) option -------------------------------------------------------------------------------- The first facility provides that each line in the first range specifi- cation will be followed by the content of the lines specified in the second range specification. The second facility provides that each line in the specified range will be followed by the entire content of the member specified. The specified member must be in the same library as the member in edit. -------------------------------------------------------------------------------- ISREDIT @ICOPY lptr-dest-range lptr-source-range ISREDIT @ICOPY lptr-dest-range membername ISREDIT @ICOPY lptr-dest-range BLANK -------------------------------------------------------------------------------- lptr-dest-range A pair of line pointers is required to demarcate the area to receive additional lines. The line pointers must be a labels. Specifying one line pointer is in- valid. lptr-source-rangeA pair of line pointers is required to demarcate the source of the interleaved copy. The membername op- tion can be used as an alternative. Since conversion to REXX the source lines may be anywhere in the data and may overlap the destination lines. membername Another member in the same library as the member un- der edit is to be the copy source. BLANK A blank line will be used as the source; therefore, you cannot process a membername of BLANK, because BLANK is a keyword for this edit macro. X Affects only lines that are EXCLUDED from the display NX Affects only lines that are NOT EXCLUDED from the display AFTER (default) source lines or member will be moved in af- ter the lines indicated in the invocation. BEFORE Source lines or member will be moved in BEFORE the lines indicated in the invocation. Examples: @ICOPY .A .B member1 @ICOPY .A .B .cbeg .cend EDIT --- IS03.SHARE.TEXT(EXAMPLE) - 01.00 ------------------ COLUMNS 001 1 24 COMMAND ===> @ICOPY .OA .OB .C .C SCROLL ===> CSR ****** **************************** TOP OF DATA *************************** ** .C this line will be copied after each line of .oa .ob .OA 01 line in range of .oa .ob 000003 02 line in range of .oa .ob .OB 03 line in range of .oa .ob 000005 000006 end of example ****** **************************** BOTTOM OF DATA ************************ ***** EDIT --- IS03.SHARE.TEXT(EXAMPLE) - 01.00 ------------------ COLUMNS 001 1 24 COMMAND ===> SCROLL ===> CSR ****** **************************** TOP OF DATA *************************** ** .C this line will be copied after each line of .oa .ob .OA 01 line in range of .oa .ob 000003 this line will be copied after each line of .oa .ob 000004 02 line in range of .oa .ob 000005 this line will be copied after each line of .oa .ob .OB 03 line in range of .oa .ob 000007 this line will be copied after each line of .oa .ob 000008 000009 end of example ****** **************************** BOTTOM OF DATA ************************ ***** PATTERN changes The following edit macro proved useful for creating lots of similar JCL Also check out the PATTERN(membername) option of the @DIR edit macro, which will copy PATTERN and replace $NAME$ in added material by each @DIR selected mem bername. content of edit macro ZCHG content of member in edit ISREDIT MACRO (NAME) .A //RESQnnn EXEC RESQ,... ISREDIT X .D .ZLAST ALL //FILEA DD DISP=SHR,dsn=...(RESQnnn ) ISREDIT @ICOPY .D .D .A .B //FILEB DD DISP=SHR,dsn=...A.(@RE SQ) ISREDIT C ALL .D .ZLAST - .B LIST,BLANKS=SINGLE,DEPTH=40 'RESQnnn' '&NAME' .D //* Example continues COMMAND ===> zchg PINX COMMAND ===> zchg PIR lines added after .D as a result of the two above commands //PIR EXEC RESQ,... //FILEA DD DISP=SHR,dsn=...(PIR) //FILEB DD DISP=SHR,dsn=...A.(PIR) LIST,BLANKS=SINGLE,DEPTH=40 //PINX EXEC RESQ,... //FILEA DD DISP=SHR,dsn=...(PINX) //FILEB DD DISP=SHR,dsn=...A.(PINX) LIST,BLANKS=SINGLE,DEPTH=40 This could also have been accomplished using PFK-24 RETRIEVE, as follows: COMMAND ===> @ICOPY .d .d .a .b;c all .d .zl word RESQnnn PINX COMMAND ===> @ICOPY .d .d .a .b;c all .d .zl word RESQnnn PIR Another technique that might work for you: Suppose you wish to copy a group of lines to the end of the member, but with each copy you wish to change a particular character string. You can effect this with the help of the PFKey-24 RETAIN. 1. Create a new member named JUNK of the lines to be copied to the end. You may change the member JUNK ahead of time so that the character string to be changed is something obvious like "xxxxxx" or even more obviously unique like "#1#" and "#2#". 2. Issue a command with your command delimiter. The semicolon (;) is the default, I prefer to use a backslash(\) or a cent sign(›) de- pending on the terminal I'm using. The command delimiter is cho- sen on the PDF option 0.1 panel. The use of a semi-colon should be avoided if you program in a PLI or use SCRIPT, because you would not be able to issue an EDIT change command on your command line that includes a semi-colon. ===> copy junk after .zl;c all #1# ABLE 3. Hit the PFKey-24 RETAIN, and change ABLE to BAKER when you rein- voke then CHARLIE, etc. ===> copy junk after .zl;c all #1# BAKER ===> copy junk after .zl;c all #1# CHARLIE ===> copy junk after .zl;c all #1# DOG ===> copy junk after .zl;c all #1# ECHO ===> copy junk after .zl;c all #1# FOX Internal Aspects: 1) Labels are verified and other requirements checked for. 2) Verification of parameters specifically for edit macro are verified. 3) Code directly relating to description is invoked. 4) Lines will be added from the bottom up.