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
 
Merging two files having unequal number of rows

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

New User


Joined: 13 Apr 2005
Posts: 1

PostPosted: Wed Apr 13, 2005 10:28 am    Post subject: Merging two files having unequal number of rows
Reply with quote

Hi, I have to merge two files. first file has suppose 100 records in SORTed order. Second file has only 30 records and the file is also in SORTed order. I want to merge the files based on the first field with total 100 records in output file.
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: Wed Apr 13, 2005 10:15 pm    Post subject:
Reply with quote

It's not clear what you want to do. If both files are in sorted order, you can MERGE them. If the first file has 100 records and the second file has 30 records, then the output file would have 130 records. Since you say you expect the output file to have 100 records, I can only guess that the 30 records in the second file have duplicates in the first file and you only want one record for each pair of duplicates. To do that, you can use this DFSORT job:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN01 DD DSN=...  input file 1
//SORTIN02 DD DSN=...  input file 2
//SORTOUT DD DSN=...  output file
//SYSIN DD *
  OPTION EQUALS
  MERGE FIELDS=(p,m,f,A)
  SUM FIELDS=NONE
/*


p,m,f is the position, length and format of the field the records are sorted on (e.g. 11,5,CH). A means the records are sorted in ascending order. If they are actually sorted in descending order, use D instead of A.

If that's not what you want, then please explain more clearly what it is you want. Examples of the input records and expected output records would help.
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 Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm
No new posts Repeat Sequence Number Until change i... rahulabvp DFSORT/ICETOOL 6 Thu Mar 29, 2018 12:51 pm
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am
No new posts help to replace columns by rows Vikas Maharnawar DFSORT/ICETOOL 8 Tue Mar 06, 2018 3:27 pm
No new posts How to build one file from two input ... daniele DFSORT/ICETOOL 5 Tue Feb 27, 2018 6:45 pm

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