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

OVERLAY 3 files data into the fourth file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Aham

New User


Joined: 24 Oct 2007
Posts: 42
Location: chennai

PostPosted: Wed Jul 09, 2008 11:29 am
Reply with quote

I have 4 files with same number of records in order in it with different record lengths as provided below:

FILEN - Record Length of 100
FILE1 - Record Length of 10
FILE2 - Record Length of 10
FILE3 - Record Length of 10

The data present in the 3 files FILE1, FLE2, FILE3 need to be overlayed into the following positions of the file FILEN respectively:

FILE1 data should be overlayed at position 21-30 in file FILEN
FILE2 data should be overlayed at position 41-50 in file FILEN
FILE3 data should be overlayed at position 61-70 in file FILEN

Records in all the files are in proper order such that data from first record of all the 3 files (FILE1,FILE2,FILE3) into the first record of the final file (FILEN) and so on till the last record.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jul 10, 2008 4:13 am
Reply with quote

Aham,

The following DFSORT/ICETOOL JCL will give you the desired results. The working of the job is explained in detail here

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.13.2.2?

Code:

//STEP0100 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//FILEN    DD *                                                 
ABC 09544 DFH                                                   
XYZ 12345 ROI                                                   
CYX 43844 AKL                                                   
//FILE1    DD *                                                 
AAAAAAAAAA                                                     
BBBBBBBBBB                                                     
CCCCCCCCCC                                                     
//FILE2    DD *                                                 
DDDDDDDDDD                                                     
EEEEEEEEEE                                                     
FFFFFFFFFF                                                     
//FILE3    DD *                                                 
GGGGGGGGGG                                                     
HHHHHHHHHH                                                     
IIIIIIIIII                                                     
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)   
//OUT      DD SYSOUT=*                                         
//TOOLIN   DD *                                         
  COPY FROM(FILEN) USING(CTL1)                         
  COPY FROM(FILE1) USING(CTL2)                         
  COPY FROM(FILE2) USING(CTL3)                         
  COPY FROM(FILE3) USING(CTL4)                         
  SPLICE FROM(T1) TO(OUT) ON(131,8,PD) WITHEACH -       
  WITH(101,10) WITH(111,10) WITH(121,10) USING(CTL5)   
//CTL1CNTL DD *                                         
  OUTFIL FNAMES=T1,OVERLAY=(101:30X,SEQNUM,8,PD)       
//CTL2CNTL DD *                                         
  OUTFIL FNAMES=T1,BUILD=(101:1,10,20X,SEQNUM,8,PD)     
//CTL3CNTL DD *                                         
  OUTFIL FNAMES=T1,BUILD=(101:10X,1,10,10X,SEQNUM,8,PD)
//CTL4CNTL DD *                                         
  OUTFIL FNAMES=T1,BUILD=(101:20X,1,10,SEQNUM,8,PD)     
//CTL5CNTL DD *                                         
  OUTFIL FNAMES=OUT,                                   
  BUILD=(01,20,101,10,31,10,111,10,51,10,121,10,71,30) 
/*


The output from this job is

Code:

ABC 09544 DFH       AAAAAAAAAA          DDDDDDDDDD          GGGGGGGGGG
XYZ 12345 ROI       BBBBBBBBBB          EEEEEEEEEE          HHHHHHHHHH
CYX 43844 AKL       CCCCCCCCCC          FFFFFFFFFF          IIIIIIIIII


Hope this helps...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top