Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2361
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 To remove spaces from a VB file using... Selvarajars DFSORT/ICETOOL 5 Thu Jun 21, 2018 6:57 pm
No new posts How to delete large data. Mounika Nemani DB2 1 Wed Jun 13, 2018 1:58 pm
No new posts Ways to share data between Cobol and ... Benchwarmer Java & MQSeries 3 Thu May 10, 2018 9:16 pm
No new posts 3270 Data stream error Benchwarmer CICS 6 Tue Apr 17, 2018 12:06 am
No new posts Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us