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

How to merge 7 files with 1 million records into single file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ralph_67

New User


Joined: 28 Feb 2007
Posts: 8
Location: India

PostPosted: Thu Mar 01, 2007 3:11 am
Reply with quote

I am having more than 7 input files which has more than 1 million records . I want to merge all the 7 files into single file

Could anyone please suggest a method for this?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Mar 01, 2007 3:21 am
Reply with quote

Hello,

If they are already in the desired sequence, you can merge them.

If they are not in sequence, you can concatenate them as one input file to the sort and create an output file in the desired sequence.

In the relative size of sorting a few million records is not too large a number.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Mar 01, 2007 3:29 am
Reply with quote

First, you have to clarify what you really want.

In order to "merge" the files, each file must already be in order by a particular key. The output would then also be in order by that key. A DFSORT merge job would look like this:

Code:

//MERGE EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN01 DD DSN=...  input file 1 (records in sorted order)
//SORTIN02 DD DSN=...  input file 2 (records in sorted order)
...
//SORTIN07 DD DSN=...  input file 7 (records in sorted order)
//SORTOUT  DD DSN=...  output file
//SYSIN    DD    *
  MERGE FIELDS=(p,m,f,s)
/*


where p,m,f,s is the start position, length, format and order.

If instead, you just want to "copy" the files one after another to the output file (no key), the DFSORT copy job would look like this:

Code:

//COPY EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file 1
//       DD DSN=...  input file 2
...
//       DD DSN=...  input file 7
//SORTOUT  DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
Ralph_67

New User


Joined: 28 Feb 2007
Posts: 8
Location: India

PostPosted: Thu Mar 01, 2007 4:35 am
Reply with quote

Thanks Frank Its really working thanks a lot icon_smile.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Mar 01, 2007 4:45 am
Reply with quote

Ah, come on Ralph, was it a merge or a copy?
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 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
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top