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
 

 

Merging records within a file using DFSORT / SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Deeptha Echampati

New User


Joined: 09 Apr 2013
Posts: 2
Location: India

PostPosted: Tue Apr 09, 2013 7:34 pm    Post subject: Merging records within a file using DFSORT / SYNCSORT
Reply with quote

Hi :

I basically need to merge 2 or MORE (I dont know how many) based on a key, the "key" is the data from position 6 to 9. . My i/p file looks like this :

I would not know how my input data will look past the 11th column. All I know is it can have data (5*522 bytes = 2610 bytes) in it.

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
0010 A000 A01& A123 AB373 A7398 A3473
0011 A000 A34& A234 AB373 A7399 A3476
0012 A000 A35& A123 AB473 A7368 A3473
0010 A001 A36& A123 AB373 A7398 A3473
0013 A002 A57& A123 AB373 A7398 A3473

O/p needs to look like :

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
A000 A01& A123 AB373 A7398 A3473 A34& A234 A7399 A3476 A35& AB473 A7368 0010 0011 0012
A001 A36& A123 AB373 A7398 A3473 0010
A002 A57& A123 AB373 A7398 A3473 0013

My shop does not support ICETOOL, can we do this using DFSORT ? The O/P needs to be merged after discarding the duplicates on the data that lies beyond the 11th column.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Apr 09, 2013 7:45 pm    Post subject:
Reply with quote

As you state both DFSORT and SYNCSORT, perhaps you could inform us of exactly which product and release level you have installed before anyone spends too much time on a wrong solution.

Also you will need to explain your problem much more clearly.
Back to top
View user's profile Send private message
Deeptha Echampati

New User


Joined: 09 Apr 2013
Posts: 2
Location: India

PostPosted: Tue Apr 09, 2013 10:30 pm    Post subject:
Reply with quote

We use SYNCSORT Rel 1.4

To put it in a simpler this is how the files must look :

Input file : (Data in position-1 to position 11) will be of fixed length. From position 13 onwards there can be 2610 bytes of data (5 bytes of 522 items). Each of these 522 bytes might not strictly be 5 bytes in length , though the data length is PIC X(5). It can have data like A34& (4 bytes).


----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
0010 A000 A01& A123 AB373
0011 A000 A34& A123
0010 A100 A567
0012 A200 A987
0013 A200 A987

Reformat file -1 : We need to split the records keeping the 1st 11 bytes constant. So basically we need to parse the data from the 13th position onwards, and split the record for every 5 byte entry present in the data beyond the 13th position.
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
0010 A000 A01&
0010 A000 A123
0010 A000 AB373
0011 A000 A34&
0011 A000 A123
0010 A100 A567
0012 A200 A987
0013 A200 A987

Final output file : This should merge back the records and produce this : The key will still be data from the 7th col to 11th col. Duplicates must be eliminated and the 1st field for every key must be appended at the end of the record.

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
0010 A000 A01& A123 AB373A34& 0010 0011
0010 A100 A567 0010
0012 A200 A987 0012 0013

I am unsure about the procedure adopted here. Pls let me know if there is a better method of doing this.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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