Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Two files need to sort& write O/P filewith HDR,Data,TRL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
babu_hi

New User


Joined: 11 Apr 2006
Posts: 93

PostPosted: Tue Aug 18, 2009 9:49 am    Post subject: Two files need to sort& write O/P filewith HDR,Data,TRL
Reply with quote

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
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2278
Location: @my desk

PostPosted: Tue Aug 18, 2009 10:40 am    Post subject:
Reply with quote

Why do you want to do it thru "COBOL SORT" and not an external SORT which would be more efficient?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Aug 18, 2009 3:43 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 18, 2009 7:44 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts getting three output files out of JOI... migusd SYNCSORT 4 Mon Jun 05, 2017 11:30 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us