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: 2285
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 Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 1 Sat Aug 19, 2017 2:33 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 10 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm
No new posts Paasing symbolic parameter to instrea... Robert Sample JCL & VSAM 2 Thu Jul 27, 2017 1:22 pm


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