View previous topic :: View next topic
|
Author |
Message |
babu_hi
New User
Joined: 11 Apr 2006 Posts: 93
|
|
|
|
have 2 files with HEADER and TRAILER,but i want to sort throught COBOL SORT on ACCOUNT NUMBER key and write in to OUTPUT file with the Header record of First file and Data records from both files and Updated count with Trailer Record.
File 1 Records
Code: |
=COLS> ----+----1----+----2----+----3-
****** ***************************** Top
000001 HDRDDA62220921109211001 -------------->HEADER Record
000002 00001422246 IS083246904U -------------->DETAILE Record
000003 00001765444 IS0493418711 -------------->DETAILE Record
000004 TRLDDA62220921109211001 -------------->TRAILER Record
****** **************************** Botto |
File 2 Records
Code: |
=COLS> ----+----1----+----2----+----3-
****** ***************************** T
000001 HDREGCD3220921109211001 -------------->HEADER Record
000002 00001413546 IS083246904U -------------->DETAILE Record
000003 00001765523 IS0493418711 -------------->DETAILE Record
000004 TRLEGCD3220921109211001 -------------->TRAILER Record
****** **************************** Bo |
I want Output like this,
Code: |
=COLS> ----+----1----+----2----+----3-
****** ***************************** Top
000001 HDRDDA62220921109211001 -------------->HEADER Record
000002 00001422246 IS083246904U -------------->DETAILE Record
000003 00001765444 IS0493418711 -------------->DETAILE Record
000002 00001413546 IS083246904U -------------->DETAILE Record
000003 00001765523 IS0493418711 -------------->DETAILE Record
000004 TTRLDDA6222 04 -------------->TRAILER Record
****** **************************** Bo |
Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Why do you want to do it thru "COBOL SORT" and not an external SORT which would be more efficient? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Quote: |
want to sort throught COBOL SORT on ACCOUNT NUMBER key and write in to OUTPUT file with the Header record of First file and Data records from both files and Updated count with Trailer Record. |
That's a statement, there is no question. I'd say, fine, just do it -- what's stoping you? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
In the SD create a new high-level sort-key that would identify the hdr, data, and trlr as 1, 2, 3. . .
Then (as Anuj suggests) - just do it. . . |
|
Back to top |
|
|
|