|
View previous topic :: View next topic
|
| Author |
Message |
joyhappi
New User
Joined: 26 Jul 2005 Posts: 4
|
|
|
|
Hi,
I have to copy 5 files having LRECL = 80 in one file having a lrecl of 400. Please note that the 2nd file should start from the 81st position and not below the file one. There should be no increase in number of rows. Only the record lenght should be increased after each file being copied successfully.
Thanks,
Joyhappi |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| It's not clear to me what you want to do (I'd rather not guess). Please show an example of the input records in each file and what the output records should look like. |
|
| Back to top |
|
 |
joyhappi
New User
Joined: 26 Jul 2005 Posts: 4
|
|
|
|
| I need to merge 5 files of lrecl = 80 in one single file. The condition is that 2nd file should begin from first row and 81st column and the third file should begin from the first row but 161st column position and so on. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Your use of the word "file" is confusing. I think you mean "record" rather than "file"? I asked you to show the input and output records, but you didn't so it's still not clear what you want. Do you want to take record n from each input file and create record n in the output file with those five input records one after the other. Something like this:
| Code: |
input file1
<file1 record1>
<file1 record2>
input file2
<file2 record1>
<file2 record2>
input file3
<file3 record1>
<file3 record2>
input file4
<file4 record1>
<file4 record2>
input file5
<file5 record1>
<file5 record2>
output file
<file1 record1><file2 record1>...<file5 record1>
<file1 record2><file2 record2>...<file5 record2>
|
If not, then please show an example of your input records and output records and explain more clearly what you want.
In the future, if you want faster answers, please provide more detailed information the first time you post. Don't make us guess. |
|
| Back to top |
|
 |
joyhappi
New User
Joined: 26 Jul 2005 Posts: 4
|
|
|
|
| Yes, this is the exact format I want. The output file should have all the records from 5 input files. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for:
| Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/80)
//IN2 DD DSN=... input file2 (FB/80)
//IN3 DD DSN=... input file3 (FB/80)
//IN4 DD DSN=... input file4 (FB/80)
//IN5 DD DSN=... input file5 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/400)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
COPY FROM(IN3) TO(T1) USING(CTL3)
COPY FROM(IN4) TO(T1) USING(CTL4)
COPY FROM(IN5) TO(T1) USING(CTL5)
SPLICE FROM(T1) TO(OUT) ON(401,8,ZD) -
WITHEACH WITH(81,80) WITH(161,80) WITH(241,80) WITH(321,80) -
USING(CTL6)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1,80,401:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
OUTREC FIELDS=(81:1,80,401:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
OUTREC FIELDS=(161:1,80,401:SEQNUM,8,ZD)
/*
//CTL4CNTL DD *
OUTREC FIELDS=(241:1,80,401:SEQNUM,8,ZD)
/*
//CTL5CNTL DD *
OUTREC FIELDS=(321:1,80,401:SEQNUM,8,ZD)
/*
//CTL6CNTL DD *
OUTFIL FNAMES=OUT,OUTREC=(1,400)
/*
|
See the following Smart DFSORT Trick for some more information on this technique:
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst03.html#t01 |
|
| Back to top |
|
 |
joyhappi
New User
Joined: 26 Jul 2005 Posts: 4
|
|
|
|
| Thanks a lot Frank. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|