IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1448
Location: Chicago, IL

PostPosted: Sun Jan 07, 2007 11:43 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Binary File format getting change whi... All Other Mainframe Topics 5
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top