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

Copy 5 files with LRECL = 80 in one file having LREC=400


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
joyhappi

New User


Joined: 26 Jul 2005
Posts: 4

PostPosted: Tue Jul 26, 2005 1:45 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Jul 26, 2005 1:49 am
Reply with quote

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
View user's profile Send private message
joyhappi

New User


Joined: 26 Jul 2005
Posts: 4

PostPosted: Tue Jul 26, 2005 1:54 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Jul 26, 2005 4:42 am
Reply with quote

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
View user's profile Send private message
joyhappi

New User


Joined: 26 Jul 2005
Posts: 4

PostPosted: Tue Jul 26, 2005 5:06 am
Reply with quote

Yes, this is the exact format I want. The output file should have all the records from 5 input files.
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: Tue Jul 26, 2005 5:18 am
Reply with quote

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
View user's profile Send private message
joyhappi

New User


Joined: 26 Jul 2005
Posts: 4

PostPosted: Tue Jul 26, 2005 5:54 am
Reply with quote

Thanks a lot Frank.
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Joining files with intermittent heade... SYNCSORT 1
No new posts IGYPG3178-I when compiling a pgm read... COBOL Programming 6
No new posts INPFIL FILES, FNAMES examples SYNCSORT 7
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
Search our Forums:


Back to Top