I'm currently using this
* Merge the LW file
*
* These sort commands can handle both the old, it's left unchanged, as
* well as the new, records are merged, LW output file.
***********************************************************************
OPTION COPY
INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'1',OR, ASA
114,1,CH,EQ,C'+',OR, Old eol
114,1,CH,EQ,C'|'), Old eol
OVERLAY=(122:C' ')),
IFTHEN=(WHEN=NONE,
OVERLAY=(122:SEQNUM,8,ZD,122:122,8,ZD,MOD,+2,M11,LENGTH=1))
*
OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(122,1,CH,EQ,C'1'),
PUSH=(123:1,121))
*
OUTFIL FTOV,VLTRIM=C' ',
OMIT=(122,1,CH,EQ,C'1'),
IFTHEN=(WHEN=(122,1,CH,EQ,C'0'),BUILD=(123,121,1,121)),
IFTHEN=(WHEN=(122,1,CH,EQ,C' '),BUILD=(1,121))
which works like a charm.
However, the input file is about to change, and as we're still not willing to
update the regression testing framework to cater for files other than FB(121),
the above has to change for additional input records, which means another
ifthen-when group. I guess it's not a problem to change the current overlay to a
fixed '1' followed by the current seqnum logic (Correct me if I'm wrong!) and
add another with a fixed '2' plus a mod +3 sequence number, the new records need
to be assembled from three records. (Yes, sigh...)
However, can I use multiple "PUSH"es? The manual tells me
<quote>You can use the following in PUSH:
c: Specifies the output position (column) to be overlaid. If you do not
specify c: for the first item, it defaults to 1:. If you do not specify c:
for any other item, it starts after the previous item. You can specify
items in any order and overlap output columns. c can be 1 to
32752.
If you specify an item that extends the output record beyond the
end of the input record, the record length is automatically
increased to that length, and blanks are filled in on the left as
needed. For variable-length records, the RDW length is increased
to correspond to the larger record length after all of the items are
processed. Missing bytes in specified input fields are replaced with
blanks so the padded fields can be processed.
p,m
***Specifies a field in the ***first input record*** of each group to be
propagated to every record of the group.*** p specifies the starting
position of the field in the input record and m specifies its length.
A field must not extend beyond position 32752.
ID=n
Specifies a ZD identifier of length n is to be added to every record
of each group. The identifier starts at 1 for the first group and is
incremented by 1 for each subsequent group. n can be 1 to 15.
SEQ=n
Specifies a ZD sequence number of length n is to be added to
every record of each group. The sequence number starts at 1 for
the first record of each group and is incremented by 1 for each
subsequent record of the group. n can be 1 to 15.[/quote]
Emphasis (***) added, which seems that I can only merge data from the first
record?
Or do I have to resort to something more exotic, like
<https://stackoverflow.com/questions/31703056/mainframes-jcl-record-transposing-using-sort/52177771#52177771>?
Robert
--
Robert AH Prins
robert.ah.prins(a)gmail.com
The hitchhiking grandfather - https://prino.neocities.org/
Some REXX code for use on z/OS - https://prino.neocities.org/zOS/zOS-Tools.html
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN