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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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