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

Merging 500 files


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

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Tue Nov 27, 2007 11:25 am
Reply with quote

Hi,

I have single FB file in which I have more than 500 files name. I need to merge all that 500 files records into single file without sorting it.

Is there anyway to do that?

Thanks,
Noor.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Nov 27, 2007 11:43 am
Reply with quote

Noor,

Sample I/P and O/P data please.
Back to top
View user's profile Send private message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Tue Nov 27, 2007 11:50 am
Reply with quote

Hi,

Sample input file - which contains file names

*****start of file*****
FILE1
FILE2
FILE3
FILE4
FILE5
.
.
.
.
.
.
FILE500
*****end of file*****
in the input file we have 500 file names, each of 500 files contain records varying from 100 to 1000.

FILE1 contains 100 records.
FILE2 contains 200 records.
FILE3 contains 103 records.
.
.
.
.
.
FILE500 contains 400 records.


I want single output which contains
100 records from FILE1
200 records from FILE2
103 records from FILE3
.
.
.
.
400 records from FILE500.

all the above no of records are merged in single ouput file.

Am I clear? Or still should i explain you more on my problem.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Nov 27, 2007 11:58 am
Reply with quote

noorkh,

Quote:
I need to merge all that 500 files records into single file without sorting it.


Why dont you copy the file names from the input file and put it in a JCL executing IEBGENER to concatenate all the input files.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Nov 27, 2007 12:01 pm
Reply with quote

Noor,

You mean to say 'File' contains some 500 file names and you would like to concatenate these files.

Just let me know, Im on right track or not.
Back to top
View user's profile Send private message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Tue Nov 27, 2007 12:18 pm
Reply with quote

Aaru,

There are around 500 such files. Easy file contains minimum 500 dataset names. Imagine how big it will be doing manually.

Murali,

File contains 500 datasset names and each of that 500 dataset contains records. i want to merge those records of all 500 into single ouptut file.
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: Tue Nov 27, 2007 12:28 pm
Reply with quote

Hello,

Your requirement is not clear.

Do you want a single output file that is the content of all of the files combined?

Is there some particular sequence the output shoud be ordered by? You mention a "merge" but a merge needs to be processed by some "key".

If you post your lrecl and some sample output records that are created from some sample input records, we may be better able to offer suggestions.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Nov 27, 2007 12:28 pm
Reply with quote

noorkh,

Quote:
Easy file contains minimum 500 dataset names. Imagine how big it will be doing manually.


Do you want this to be done using SORT? I would use REXX for this requirement .
Back to top
View user's profile Send private message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Tue Nov 27, 2007 12:38 pm
Reply with quote

Hi Dick,

Yes I need single file that is the content of all of the files records combined.

LRECL will be 80.

No need to merge on any key basis. just copy from that files and concatenate it.( i should not say merge it is just concatenation i require).
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: Tue Nov 27, 2007 12:47 pm
Reply with quote

Hello,

You might read your control files and create concatenated jcl to copy the many files into a resulting single file.

Keep in mind that as you are generating the sets of jcl, you sould limit your concatenated datasets to some managable number (say 200).

As each is run, you could MOD onto the eventual final output file.

Accomplishing the process via your sort program will perform better than IEBGENER or IDCAMS.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Nov 27, 2007 1:10 pm
Reply with quote

Noor,

You can achive using two jobs -

Job1:

Code:
//S1    EXEC  PGM=SORT                                     
//SYSOUT DD SYSOUT=*                                       
//SYSPRINT DD SYSOUT=*                                     
//SORTIN DD *                                             
&SYSUID..FILE1                                             
&SYSUID..FILE30                                           
&SYSUID..FILE500                                           
/*
//**** PLEASE MAKE SURE BELOW PDS EXIST ****
//SORTOUT DD DSN=&SYSUID..TRIAL(DDDDS),DISP=SHR     
//SYSIN DD *                                               
  INREC OVERLAY=(81:SEQNUM,3,ZD)                           
  SORT FIELDS=COPY                                         
  OUTREC IFTHEN=(WHEN=(81,3,ZD,EQ,+1),                     
       BUILD=(C'//SORTIN  DD DISP=SHR,DSN=',1,44,80:X)),   
         IFTHEN=(WHEN=(81,3,ZD,GT,+1),                     
       BUILD=(C'//   DD DISP=SHR,DSN=',1,44,80:X))         
/*
//*
//STEP2 FOR SUBMITTING JOB2 IF ABOVE S1.RC=0


Job2:
Code:
//   JCLLIB   ORDER=&SYSUID..TRIAL               
//*                                                   
//JOB2S1    EXEC  PGM=SORT                                 
//SYSOUT DD SYSOUT=*                                   
//SYSPRINT DD SYSOUT=*                                 
//    INCLUDE MEMBER=DDDDS                             
//SORTOUT DD DSN=O/P FILE........                                 
//SYSIN DD *                                           
   SORT FIELDS=COPY                                   
/*                                                     


Please make sure number of dd statements never crosses the limit.
Back to top
View user's profile Send private message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Tue Nov 27, 2007 2:22 pm
Reply with quote

Hi Dick, Murali,

Thanks for your help. I did it the way you said. It is working fine. Thanks for your help.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Nov 27, 2007 2:24 pm
Reply with quote

You are welc icon_biggrin.gif me Noor!!!!
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top