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
 

 

Merging 500 files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Merging 500 files
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: 1439
Location: Bangalore,India

PostPosted: Tue Nov 27, 2007 11:43 am    Post subject:
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Tue Nov 27, 2007 11:58 am    Post subject: Reply to: Merging 500 files
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: 1439
Location: Bangalore,India

PostPosted: Tue Nov 27, 2007 12:01 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Nov 27, 2007 12:28 pm    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Tue Nov 27, 2007 12:28 pm    Post subject: Reply to: Merging 500 files
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    Post subject:
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

Site Director


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

PostPosted: Tue Nov 27, 2007 12:47 pm    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Tue Nov 27, 2007 1:10 pm    Post subject:
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Tue Nov 27, 2007 2:24 pm    Post subject:
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    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 getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


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