Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
For your GROUP, PUSH your entire identifying record onto each item in the group: PUSH=(81:1,80... and include a SEQ. Use RECORDS=8
Use a second GROUP which is for sequence number equal to two, RECORDS=7. This is to PUSH the third position to all the records.
First OUTFIL with INCLUDE= for all the extra position being "-". IFTHEN=(WHEN=(sequence number is two),BUILD=(81,80,/,1,80), IFTHEN=(WHEN=NONE),BUILD=1,80
Second OUTFIL with OMIT= for above and for all sequence number to to one records. Same BUILDs
For your GROUP, PUSH your entire identifying record onto each item in the group: PUSH=(81:1,80... and include a SEQ. Use RECORDS=8
Use a second GROUP which is for sequence number equal to twp, RECORDS=7. This is to PUSH the third position to all the records.
First OUTFIL with INCLUDE= for all the extra position being "-". IFTHEN=(WHEN=(sequence number is two),BUILD=(81,80,/,1,80), IFTHEN=(WHEN=NONE),BUILD=1,80
Second OUTFIL with OMIT= for above and for all sequence number to to one records. Same BUILDs
Hi Bill,
I got confused with the 2 Group condition. Could you please explain about the 2 Group Selection.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
The first GROUP is going to put the first record onto each member of the group, with a sequence number. The actual first record is no longer needed as it will be recreated later.
Now you need your selection criteria (the "-") on each record of the group. So you start a GROUP for the sequence number two, and PUSH that position onto all the records in the second group.
Then in OUTFIL you get all the records you want, plus re-BUILD the first record first. Opposite for the other OUTFIL, though there you have to exclude the unwanted zero-sequence records as well.
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,80,SS,EQ,C'@'),RECORDS=8,
PUSH=(81:1,80,161:SEQNUM,8,ZD))
*
IFTHEN=(WHEN=GROUP,BEGIN=(161,8,ZD,EQ,2,AND,83,1,CH,EQ,C'-'),
*
RECORDS=7,PUSH=(171:83,1))
*
OUTFIL FNAMES=OUT11,
INCLUDE=(161,8,ZD,EQ,1,OR,171,1,CH,EQ,C'-'),
BUILD=(81,80)
OUTFIL FNAMES=OUT12
INCLUDE=(161,8,ZD,NE,1,AND,171,1,CH,NE,C'-'),
*
BUILD=(81,80)
*
WER161B ALTERNATE PARM USED
WER268A INREC STATEMENT : SYNTAX ERROR
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER268A INCLUDE STATEMENT : SYNTAX ERROR
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Look at the manual for PUSH. Even if SEQNUM were correct, that is an eight-digit number you are trying to allow for, not a one-digit (which happens to have a maximum value of eight).
Follow enrico's advice. I've spotted one problem, don't have time for more now, so you've wasted that shot...
Hi Bill,
In this case, wouldn't having '/' in the OUTFIL make us have another pass to split the file?
I could build the first record as below, but was wondering if the splitting can happen in the same step rather than a separate step.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
That's one reason for wanting the sequence number of the group on the record. When it is two, do thee BUILD=(81,80,/,1,80) otherwise just BUILD=(1,80).
The other reason is to exclude the first record of a group, becaue the selection criteria is unknown (which is why we do the first bit...).
Bill, I had initially used OUTREC instead of the OUTFIL in the above code, but '/' did not work on my OUTREC. Then ended up replacing OUTREC with OUTFIL which worked, but I had no place for my OUTFIL FNAMES. I dont know if I am missing something here..
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
OUTFIL FNAMES=OUT11, you need INCLUDE for the selction character. IFTHEN=(WHEN=(logical expression) for seq value being "2" to do the BUILD with the slash-operator and IFTHEN=(WHEN=NONE to do the oridinary BUILD.
For the second OUTFIL, needs to OMIT everything the first OUTFIL has, plus the seq = C'1' records, same IFTHEN processing for the two BUILDs.
OUT11 and OUT12 Files are same as Input file. IFTHEN=(WHEN=NONE, condition is including all other records as well. Is there any other way to get only the required one.