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
 
Need help in adding Header to records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 23
Location: mumbai

PostPosted: Thu Mar 07, 2019 7:55 pm    Post subject: Need help in adding Header to records
Reply with quote

Hi,

I have a input file in below format

Code:
DTL001111111 1234567890123-0000001R01/10/20181234567890xxxxx 123
DTL001111111 2345678901234-0000003R01/10/20181234567890xxxxx 123
DTL001111111 3456789012345-0000004R01/10/20181234567890xxxxx 123
DTL002222222 1234567890123-0000001R01/10/20181234567890xxxxx 124
DTL002222222 2345678901234-0000003R01/10/20181234567890xxxxx 124
DTL002222222 3456789012345-0000004R01/10/20181234567890xxxxx 123


the records should be grouped based on position 61,3 (123 or 124) and position 1,12(DTL0011111111 or DTL00222222222) then Header should be added to group.Header formate is as below

HDR1230011111111 P111111 000 1
the output should be as below

Code:
HDR123001111111 P111111                          000 1
DTL001111111 1234567890123-0000001R01/10/20181234567890xxxxx 123
DTL001111111 2345678901234-0000003R01/10/20181234567890xxxxx 123
DTL001111111 3456789012345-0000004R01/10/20181234567890xxxxx 123
HDR123002222222 P111111                          000 1
DTL002222222 3456789012345-0000004R01/10/20181234567890xxxxx 123
HDR124002222222 P111111                          000 1
DTL002222222 1234567890123-0000001R01/10/20181234567890xxxxx 124
DTL002222222 2345678901234-0000003R01/10/20181234567890xxxxx 124
TRL


Input record length is 65
output record length is 65.

Please lets me know if it can be done by SORT?

If it can be done in sort pls give idea to write sort condition for this requirement.

Thanks,
Sen
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2165
Location: NY,USA

PostPosted: Thu Mar 07, 2019 8:16 pm    Post subject:
Reply with quote

One way is below way and for more alternatives please Google it or search over here and let us know what you try or face any issues.
http://ibmmainframes.com/about24473.html
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Summing records conditional statements. chillmo SYNCSORT 13 Wed May 15, 2019 2:12 am
No new posts count the number of records from diff... janmejay CA Products 4 Mon Mar 25, 2019 11:29 pm
No new posts Count the records and Create Header a... thesumitk DFSORT/ICETOOL 2 Mon Mar 04, 2019 11:18 pm
No new posts Copy Group of Records scorp_rahul23 DFSORT/ICETOOL 1 Sun Jan 13, 2019 9:17 am
No new posts Joining 2 records to 1 using Sort cmuncan DFSORT/ICETOOL 1 Sat Dec 08, 2018 8:53 am

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