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
 

 

Merge Records in a file based on a key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sthirumalai

New User


Joined: 14 Aug 2007
Posts: 14
Location: Chennai

PostPosted: Tue Dec 07, 2010 12:54 am    Post subject: Merge Records in a file based on a key
Reply with quote

Hi,

I have an Input file similar to the one given below

Code:
000001XXXXXXSPACESYYYYYSPACES
000001SPACESZZZZZZSPACESAAAAAA


I have to merge the two records in the I/P file based on the key 000001 (1:6)

The output should look like

Code:

000001XXXXXZZZZZYYYYYAAAAA


Is there any way to do this using DFSORT or ICETOOL?

Your help is appreciated.

Regards
Santhosh
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Dec 07, 2010 2:25 am    Post subject:
Reply with quote

Your output doesn't seem to match your input. For example, in the input you show 6 X's but in the output you show 5 X's, etc.

Does your input file only have two records, or can it have more? If more, then show a better example with more records.

Give the RECFM and LRECL of the input file. Give the starting position, length and format of each field in the input record, and in the output record.

BTW, this is not a "merge". It's a SPLICE.
Back to top
View user's profile Send private message
sthirumalai

New User


Joined: 14 Aug 2007
Posts: 14
Location: Chennai

PostPosted: Tue Dec 07, 2010 3:27 am    Post subject: Reply to: Merge Records in a file based on a key
Reply with quote

Hi Frank,

Thanks for your response

My input file is 80 Bytes FB

I apologize for the incorrect I/P data. Here is the corrected one

000002XXXXXSPACESYYYYYSPACES
000001XXXXXSPACESYYYYYSPACES
000001SPACESZZZZZSPACESAAAAA
000002SPACESZZZZZSPACESAAAAA

The output file is 80 Bytes FB and that should look like
000001XXXXXZZZZZYYYYYAAAAA
000002XXXXXZZZZZYYYYYAAAAA

My I/P files will contain more than two records.

Key - 1,6,CH
FIELD1 - 7,5,CH
FIELD2 - 12,5,CH
FIELD3 - 17,5,CH
FIELD4 - 22,5,CH

Please let me know if you need more details

Regards
Santhosh
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Dec 07, 2010 3:35 am    Post subject:
Reply with quote

Quote:
My I/P files will contain more than two records.


Ok. But it's still not clear what your input can look like.

Will each key have a pair of records as shown in your example?

Could a key have only one record? Could a key have more than two records? If so, what does the input look like for these variations and what do you want for output?

For the same key, does the record with field1 always come before the record with field2, or could they be reversed, e.g.

000003SPACESZZZZZSPACESAAAAA
000003XXXXXSPACESYYYYYSPACES

I really need a complete picture of what variations you can have for the input records before I can give you a complete solution.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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