Here's my thoughts.
Step 1: split the file into FILE1(The first 2 lines), FILE2(B/C/D/E lines), FILE3(Trailer line)
Step 2: Create FILE3 by Concatenate B/C/D/E lines into one single line from FILE2 using RESIZE function.
Step 3: Create FILE4 omit records if col 1311-1312 not in specific range and using RESIZE function to split the concatenation line into 4 B/C/D/E lines.
Step 4: Combine FILE1, FILE4, FILE3 into the final file FILE5.
It seems too complex, I would like to ask for help if any simple solution on it. Many thanks!
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
You already have a very similar topic. Have you thought to apply the same technique? GROUP, PUSH the entire record, GROUP, PUSH the country-code, INCLUDE=/OMIT= on OUTFIL. You should already have enough to do it, you just have to reallise it is a similar thing. Unless I'm mis-reading...
You already have a very similar topic. Have you thought to apply the same technique? GROUP, PUSH the entire record, GROUP, PUSH the country-code, INCLUDE=/OMIT= on OUTFIL. You should already have enough to do it, you just have to reallise it is a similar thing. Unless I'm mis-reading...
Hi Bill,
Yes, i know the GROUP/PUSH technique, but i can't have a solution about how to push the country code from D line to every lines of the group B/C/D/E lines
You said push the entire record, do you mean push the entire B record?
Code:
B+B
C+B
D+B
E+B
B+B
C+B
D+B
E+B
However, the country code is in col 287-288 D line, how to make sure the country code will be pushed to every lines of group B/C/D/E?
[/quote]
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
You should, I think, be able to appy the same technique as used in [http://ibmmainframes.com/viewtopic.php?p=322603#322603]this[/url] one. If that does not work, you could look at the "offset" JOINKEYS. You join on sequence numbers allocated in both JNFnCNTL files, one starts from zero, the other starts from one. When you have the match, you have "current" and "previous" record at the same time. There's a recent example either in here or in the JCL part of the forum for SyncSort.
If you can apply neither, explain why, show sample input expected out.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Thanks for letting us know and posting what works for you. When the data slipped from the 'C' to the 'D' record, you got yourself a solution.
Be aware that it relies upon the 'D' record, always, always, being present. I'd have a quick review that something somewhere else already verifies the integrity of the file.