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
 

 

Combine all the columns from two files in to a single file

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

New User


Joined: 31 Dec 2006
Posts: 8
Location: Chennai

PostPosted: Sun Jan 07, 2007 11:05 am    Post subject: Combine all the columns from two files in to a single file
Reply with quote

Hi
My requirement is :

I have two files of different record lengths. I need to combine all the columns of the two files in to a single file , with the common columns(headings) occurring only once in the output file.

Example :
File A:
columns : id, no, date, month
File B:
columns : week, id, no,

I need to create an output file with the columns :
id,no,date,month,week (the common columns id and no should occur only once). When i try to match the records in the files using the id and no fields as the key, if i find a match , the corresponding fields should be populated in the output file.
If a id , no record combination occurs only in file, then it should be written in to the output file with the columns corresponding to the second file being populated with spaces

Can this be done using a jcl, or do i have to do it through a program to compare the files based on id and no and write the output file
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Sun Jan 07, 2007 11:43 am    Post subject: Re: Combine all the columns from two files in to a single fi
Reply with quote

Quote:
Can this be done using a jcl, or do i have to do it through a program to compare the files based on id and no and write the output file

Yes, it can be done using JCL SORT... check if below stuff work for you, else writing program can also be accomplished for the same... not a big deal...
Here is a solution by DFSORT of what you are asking for... You would need to change the SORT Code adjusting length & position of the common key fields for two files... alongwith total length of the files...

Look for the topic described for:- Join fields from two files on a key
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 Data replication from multiple Db2 ta... kishpra DB2 0 Mon Mar 27, 2017 9:58 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 3 Mon Mar 27, 2017 3:59 pm
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


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