View previous topic :: View next topic
|
Author |
Message |
noorkh
New User
Joined: 06 Mar 2006 Posts: 76 Location: Chennai
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Noor,
Sample I/P and O/P data please. |
|
Back to top |
|
|
noorkh
New User
Joined: 06 Mar 2006 Posts: 76 Location: Chennai
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
noorkh
New User
Joined: 06 Mar 2006 Posts: 76 Location: Chennai
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
noorkh
New User
Joined: 06 Mar 2006 Posts: 76 Location: Chennai
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
noorkh
New User
Joined: 06 Mar 2006 Posts: 76 Location: Chennai
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
You are welc me Noor!!!! |
|
Back to top |
|
|
|