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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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