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
 
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 Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 3 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm

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