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

ICETOOL to merge 2 input datasets.


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

New User


Joined: 11 Mar 2008
Posts: 8
Location: pune

PostPosted: Thu Mar 20, 2008 4:25 pm
Reply with quote

I have 2 input files (both with lrecl 2221).
For first file, i have to replace the existing value for last column no. 2221 with '1'.
After this change is implemented in the fisrt file, then I want to merge that to the 2nd file. (2nd file has last column values as either '2' or '3' or '4')

I want 2 outputs to get generated.
Output1 file will have all records from first 2 files. (please remeber that 1st file after doing the above mentioned modification + 2nd file)
Output2 file will have (1st file after doing the above mentioned modification + records from 2nd file having value for column 2221 as '3' or '4' only)

I was able to place a value '1' in the last column of 1st file.. but now I m stucked at the point about how to merge that modified file1 with file2 and use for further processing and don't know how to code that.

This is my JCL

Code:

//STEP010  EXEC  PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//ACTIVES  DD DISP=SHR,DSN=GRMIW9.TEST.M28.EWJDNBWB.ACTIVES       
//INACTIVS DD DISP=SHR,DSN=GRMIW9.TEST.DLRDUNS.MATCHED           
//TEMP1    DD DSN=&&TEMP1,                                       
//         SPACE=(CYL,(100,100),RLSE),                           
//         DCB=(RECFM=FB,LRECL=2221,BLKSIZE=31094)               
//MERGE    DD DSN=GRMIW9.TEST.M28.WITH1,                         
//         DISP=(NEW,CATLG),UNIT=SYSDA,                           
//         DCB=(RECFM=FB,LRECL=2221,BLKSIZE=31094)               
//TOOLIN   DD *                                                   
 COPY FROM(ACTIVES) TO(TEMP1) USING(ACTS)                         
/*                                                               
//ACTSCNTL  DD *                                                 
 SORT FIELDS=COPY                                                 
 OUTREC OVERLAY=(2221:C'1')                                       
/*     


Could u please help me to complete this one to get the desired output?

Thanks in advance.
Dhanashree.
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: Thu Mar 20, 2008 8:21 pm
Reply with quote

You can use a DFSORT/ICETOOL job like the following to do what you asked for:

Code:

//S1 EXEC  PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN1  DD DSN=...  input file1 (FB/2221)
//IN2  DD DSN=...  input file2 (FB/2221)
//***>>> USE MOD DATA SETS FOR OUT1 AND OUT2
//OUT1 DD DISP=MOD,DSN=... output file1 (FB/2221)
//OUT2 DD DISP=MOD,DSN=... output file2 (FB/2221)
//TOOLIN   DD *
COPY FROM(IN1) TO(OUT1,OUT2) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
/*
//CTL1CNTL  DD *
  INREC OVERLAY=(2221:C'1')
/*
//CTL2CNTL  DD *
  OUTFIL FNAMES=OUT1
  OUTFIL FNAMES=OUT2,INCLUDE=(2221,1,SS,EQ,C'3,4')
/*
Back to top
View user's profile Send private message
dhanashreeakhade

New User


Joined: 11 Mar 2008
Posts: 8
Location: pune

PostPosted: Mon Mar 24, 2008 11:41 am
Reply with quote

Thanks a Lot!

Dhanashree.
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top