MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Concatenation of Sequential Files.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
vspangtey
Beginner


Joined: 13 Jun 2003
Posts: 7
Topics: 3

PostPosted: Thu Aug 14, 2003 3:04 am    Post subject: Concatenation of Sequential Files. Reply with quote

Hi all,

I am having four input files
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Aug 14, 2003 5:49 am    Post subject: Reply with quote

vineet,

did you check this topic?

http://www.mvsforums.com/helpboards/viewtopic.php?t=10

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Aug 14, 2003 10:43 am    Post subject: Reply with quote

Vineet,

You can do this with the SPLICE operator of DFSORT's ICETOOL as illustrated by the DFSORT/ICETOOL job below.

You didn't give any information about the RECFM and LRECL of your four input files, or what the records actually look like, so I made the following assumptions for the example:

Each input file has RECFM=FB and LRECL=20. The input files look like this:

Code:

Input file1                     
KEY1 FILE1 RECORD01>         
KEY2 FILE1 RECORD02>         
KEY3 FILE1 RECORD03>         

Input file2                     
KEY1 FILE2 RECORD01>         
KEY2 FILE2 RECORD02>         
KEY3 FILE2 RECORD03>         

Input file3                     
KEY1 FILE3 RECORD01>         
KEY2 FILE3 RECORD02>         
KEY3 FILE3 RECORD03>         

Input file4                     
KEY1 FILE4 RECORD01>         
KEY2 FILE4 RECORD02>         
KEY3 FILE4 RECORD03>         


Here's the DFSORT/ICETOOL job:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//A1  DD DSN=...  input file1
//A2  DD DSN=...  input file2
//A3  DD DSN=...  input file3
//A4  DD DSN=...  input file4
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T3 DD DSN=&&T3,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T4 DD DSN=&&T4,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//    DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,PASS)
//    DD DSN=*.T3,VOL=REF=*.T3,DISP=(OLD,PASS)
//    DD DSN=*.T4,VOL=REF=*.T4,DISP=(OLD,PASS)
//COMBINE DD DSN=...  output file
//TOOLIN DD *
* Reformat File1-File4 records for splicing
  COPY FROM(A1) TO(T1) USING(CTL1)
  COPY FROM(A2) TO(T2) USING(CTL2)
  COPY FROM(A3) TO(T3) USING(CTL3)
  COPY FROM(A4) TO(T4) USING(CTL4)
* Splice File2-File4 data into File1 records
  SPLICE FROM(CON) TO(COMBINE) ON(1,4,CH) -
    WITHEACH WITH(21,20) WITH(41,20) WITH(61,20)
/*
//CTL1CNTL DD *
* Reformat File1 records to:
* |Key|F1Data|blanks|blanks|blanks|
  1          21     41     61    80
  OUTREC FIELDS=(1,20,80:X)
/*
//CTL2CNTL DD *
* Reformat File2 records to:
* |Key|blanks|F2Data|blanks|blanks|
  1          21     41     61    80
  OUTREC FIELDS=(1:1,4,21:1,20,80:X)
/*
//CTL3CNTL DD *
* Reformat File3 records to:
* |Key|blanks|blanks|F3Data|blanks|
  1          21     41     61    80
  OUTREC FIELDS=(1:1,4,41:1,20,80:X)
/*
//CTL4CNTL DD *
* Reformat File4 records to:
* |Key|blanks|blanks|blanks|F4Data|
  1          21     41     61    80
  OUTREC FIELDS=(1:1,4,61:1,20)
/*


The COMBINE output looks like this:

Code:

KEY1 FILE1 RECORD01>KEY1 FILE2 RECORD01>KEY1 FILE3 RECORD01>KEY1 FILE4 RECORD01>
KEY2 FILE1 RECORD02>KEY2 FILE2 RECORD02>KEY2 FILE3 RECORD02>KEY2 FILE4 RECORD02>
KEY3 FILE1 RECORD03>KEY3 FILE2 RECORD03>KEY3 FILE3 RECORD03>KEY3 FILE4 RECORD03>


If you want a job more specific to your situation, tell me the RECFM and LRECL of each input file, and the position, length and format of the key.

For complete details on DFSORT's SPLICE operator, see:

http://www.storage.ibm.com/software/sort/mvs/uq90053/online/srtmutol.html#spl
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vspangtey
Beginner


Joined: 13 Jun 2003
Posts: 7
Topics: 3

PostPosted: Tue Aug 19, 2003 2:35 am    Post subject: Reply with quote

Hi Kolusu/Frank,

Thanks a lot for your inputs. It was a great help.

Regards,
Vineet.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group