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

ICETOOL Help Required


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

New User


Joined: 22 Oct 2010
Posts: 4
Location: NJ

PostPosted: Fri Oct 22, 2010 6:44 am
Reply with quote

Hi,

I have two input files of size 70 Bytes each. Key is ( 1-13) is both the files.

O/p Length : 140 bytes ( Size of File 1 & File 2)

If the key in the first file matches with 2nd file , then need to add file contents ( other than key) to the first file record from 71st position.

Even for the duplicate record, I want the same info to be added as given in RED


Input File 1:
---------------

ATL1234567800YYY...................... YY
ATL1234567900YYY .................... YY
ATL1234568100YYY ...................... YY
ATL1234568100ZZZ ......................ZZ


Input File 2:
-------------

ATL1234567800XXX............AA
ATL1234567900XXX.............BB
ATL1234568100XXX.............CC
ATL9999999900XXX.............DD


O/p Required:
----------------


ATL1234567800YYY...................... YY ATL1234567800XXX............AA
ATL1234567900YYY .................... YY ATL1234567900XXX.............BB
ATL1234568100YYY ...................... YY ATL1234568100XXX.............CC
ATL1234568100ZZZ ......................ZZ ATL1234568100XXX.............CC



I tried with below JCL but duplicate records are NOT coming in the record

Code:
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN1      DD DSN=TSUEI4F.RVWDAT.JAN2AUG.SAMPLE,DISP=SHR             
//IN2      DD DSN=TSUEI4F.DM.DRCLAIM.SAMPLE,DISP=SHR                 
//TEMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(CYL,(500,400),RLSE),   
//             UNIT=SYSDA                                           
//COMBINE DD  DSN=TSUEI4F.SAMPLE.OUTP59,                             
//            DISP=(NEW,CATLG,CATLG),                               
//            SPACE=(CYL,(500,400),RLSE),                           
//            DCB=(RECFM=FB,LRECL=140,BLKSIZE=0)                     
//*                                                                 
//TOOLIN   DD *                                                     
    COPY FROM(IN1) TO(TEMP1) USING(CTL1)                             
    COPY FROM(IN2) TO(TEMP1) USING(CTL2)                             
    SPLICE FROM(TEMP1) TO(COMBINE) ON(1,13,ZD) -                     
    WITH(66,70)                                                     
/*                                                                   
//CTL1CNTL DD *                                                     
   OUTREC FIELDS=(1,65,140:X)                                       
/*                                                                   
//CTL2CNTL DD *                                                     
   OUTREC FIELDS=(1:1,13,    PUT FILE2 KEY IN SAME PLACE AS FILE1 KEY
                  66:14,57)  FILE2 DATA                             
/*                                   



O/P of above JCL is :

ATL1234567800YYY...................... YY ATL1234567800XXX............AA
ATL1234567900YYY .................... YY ATL1234567900XXX.............BB
ATL1234568100YYY ...................... YY ATL1234568100XXX.............CC


Here the below duplicate record is missing.

ATL1234568100ZZZ ......................ZZ ATL1234568100XXX.............CC

Your help is highly appreciated.

Thanks,
Back to top
View user's profile Send private message
vinodjain

New User


Joined: 22 Oct 2010
Posts: 4
Location: NJ

PostPosted: Fri Oct 22, 2010 8:23 am
Reply with quote

There was a typo in prev message with Output file required and what i am getting now.


O/p Required:
----------------


ATL1234567800YYY...................... YY XXX............AA
ATL1234567900YYY .................... YY XXX.............BB
ATL1234568100YYY ...................... YY XXX.............CC
ATL1234568100ZZZ ......................ZZ XXX.............CC


O/P of that I got using the JCL in pre message is :

ATL1234567800YYY...................... YY XXX............AA
ATL1234567900YYY .................... YY XXX.............BB
ATL1234568100YYY ...................... YY XXX.............CC
Back to top
View user's profile Send private message
nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Fri Oct 22, 2010 12:47 pm
Reply with quote

Hi Vinod,

The below DFSORT JCL will give you the desire Output. Assumed your RECFM=FB.
Code:
//STEP10   EXEC PGM=SORT                                               
//*                                                                     
//SYSOUT   DD  SYSOUT=*                                                 
//*                                                                     
//SORTJNF1 DD *                                                         
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
ATL1234567800YYY....................................................YY 
ATL1234567900YYY ...................................................YY 
ATL1234568100YYY ...................................................YY 
ATL1234568100ZZZ ...................................................ZZ 
/*                                                                     
//*                                                                     
//SORTJNF2 DD *                                                         
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
ATL1234567800XXX....................................................AA 
ATL1234567900XXX....................................................BB 
ATL1234568100XXX....................................................CC 
ATL9999999900XXX....................................................DD 
/*                                                                     
//*                                                                     
//OUT      DD  SYSOUT=*                                                 
//*                                                                     
//SYSIN    DD  *    *** CONSTANT CONTROL CARDS ***                     
  JOINKEYS FILES=F1,FIELDS=(1,13,A)                                     
  JOINKEYS FILES=F2,FIELDS=(1,13,A)                                     
  JOIN UNPAIRED                                                         
  REFORMAT FIELDS=(F1:1,70,?,F2:1,70)                                   
  OPTION COPY                                                           
  OUTFIL FNAMES=OUT,INCLUDE=(71,1,CH,EQ,C'B'),BUILD=(1,70,85,57,13X)       
/*                                                                     

Hope this helps you.
Back to top
View user's profile Send private message
vinodjain

New User


Joined: 22 Oct 2010
Posts: 4
Location: NJ

PostPosted: Fri Oct 22, 2010 6:04 pm
Reply with quote

Thanks Nelson for the response. It worked.

Appreciate your help.

Thanks,
Vinod Jain
Back to top
View user's profile Send private message
vinodjain

New User


Joined: 22 Oct 2010
Posts: 4
Location: NJ

PostPosted: Fri Oct 22, 2010 7:51 pm
Reply with quote

Nelson, One question here:


Can you please explain me the below related to Include and Build parameters

OUTFIL FNAMES=OUT,INCLUDE=(71,1,CH,EQ,C'B'),BUILD=(1,70,85,57,13X)
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: Fri Oct 22, 2010 10:58 pm
Reply with quote

Vinod,

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
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 Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts ICETOOL to Read records SMF CEF it is... DFSORT/ICETOOL 4
Search our Forums:

Back to Top