View previous topic :: View next topic
|
Author |
Message |
liam,khaosong
New User
Joined: 24 Jul 2014 Posts: 2 Location: FRANCE
|
|
|
|
Hello all,
I have a flat ASA file (lrecl=133), who contents :
Code: |
1PAGE 01 DOC : 2014
PAGE 01 LINE 2
PAGE 01 LINE 3
PAGE 01 LINE 4
PAGE 01 LINE 5
PAGE 01 LINE 6
1PAGE 02
PAGE 02 LINE 1
PAGE 02 LINE 2
1PAGE 03 DOC : 2014
PAGE 03 LINE 1
1PAGE 04 DOC : 2014
PAGE 04 LINE 2
PAGE 04 LINE 3
PAGE 04 LINE 4
1PAGE 05 DOC : 2014
PAGE 05 LINE 2
1PAGE 06 DOC : 2014
PAGE 06 LINE 2
1PAGE 07 DOC : 2014
PAGE 07 LINE 1
PAGE 07 LINE 2
|
Thus the "DOC number 1" contains 2 pages, the DOC number 2 begins at page 3...
Every DOC begins with "DOC : 2014" and contents x pages and y lines per page.
I want only the 2 first DOCs with all pages and lines AND the 2 last DOCs with all pages and lines also, all in one pass if possible.
I wrote a small ASM program who do this but my boss prefers ICETOOL or DFSORT for production.
It's possible ?
Thank a lot |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
JOINKEYS with the same file on both input DDs.
In JNF1CNTL using INREC with WHEN=GROUP for the DOC to PUSH an ID to an extension of the record.
In JNF2CNTL use INCLUDE to get only the DOC records. Use INREC to put a sequence number in an extension to the record (same length as the ID you PUSHed in the other). Then subtract two from the sequence number.
A REFORMAT statement with the entire F1 record and the match marker.
JOIN UNPAIRED,F1
In the main task, INCLUDE for (match marker equal to B AND extension equal to 1 or 2), OR match marker equal to 1 (unmatched records).
Strip off the extension with BUILD on INREC. |
|
Back to top |
|
|
liam,khaosong
New User
Joined: 24 Jul 2014 Posts: 2 Location: FRANCE
|
|
|
|
Thank you very much Bill
but...
I would not want to abuse but would it be possible that you put the complete code ? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Of course it would be possible, but time precludes.
Take it one piece at a time, with shortened/simplified data and watch how it builds up (don't use OUTFIL until you can see what is happening to everything). |
|
Back to top |
|
|
|