ICETOOL: Matching Records for VB Files



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

ICETOOL: Matching Records for VB Files

Postby anil4321 » Thu Nov 20, 2008 3:39 am

I am trying to find the matching records between two variable record files based on the first 9 characters of both files. Combined file will have the following format:

1. First 9 chracters of matching records,
2. 16 Characters from position 10 infile 1 and
3. 16 characters from position 10 from file2.

I am sure I am doing someting wrong so that the combined file is getting only 15 characters from file1 and only 13 characters fro m file2. Could anyone tell me what I am missing?

Here are the inputs:

FILE1: VB, Record length:29
123456781XXXXXXXXXXXXXXXX
123456782YYYYYYYYYYYYYYYY
123456783ZZZZZZZZZZZZZZZZ
123456784AAAAAAAAAAAAAAAA

FILE2: VB, Record length:29
123456781BBBBBBBBBBBBBBBB
123456782CCCCCCCCCCCCCCCC
123456785ZZZZZZZZZZZZZZZZ

Combined File from My JCL
123456781XXXXXXXXXXXXXXXBBBBBBBBBBBBB
123456782YYYYYYYYYYYYYYYCCCCCCCCCCCCC

Here is my JCL:

//S3 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=CAB55.TEST.SORT1,DISP=SHR
//IN2 DD DSN=CAB55.TEST.SORT2,DISP=SHR
//T1      DD DSN=&&T1,DISP=(MOD,PASS),UNIT=SYSDA,SPACE=(TRK,(5,5))
//*COMBINE DD SYSOUT=*
//OUT1    DD SYSOUT=*
//OUT2    DD SYSOUT=*
//OUT12   DD SYSOUT=*
//COMBINE DD DSN=CAB55.TEST.MATCHING,DISP=SHR
//TOOLIN  DD *
  COPY FROM(IN1) TO(T1) USING(CTL1)
  COPY FROM(IN2) TO(T1) USING(CTL2)
  SPLICE FROM(T1) TO(COMBINE) ON(5,9,ZD) WITH(29,16)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,4,5,25,
                 44:X)
/*
//CTL2CNTL DD *
  OUTREC FIELDS=(1,4,5:5,9,
                 26:14,16)
/*
anil4321
 
Posts: 11
Joined: Wed Nov 19, 2008 4:23 am
Has thanked: 0 time
Been thanked: 0 time

Re: ICETOOL: Matching Records for VB Files

Postby Frank Yaeger » Thu Nov 20, 2008 4:12 am

The positions you used are a bit off. You should have WITH(30,16), 45:X and 30:14,16.

Here's a correct DFSORT/ICETOOL job to do what you asked for:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=CAB55.TEST.SORT1,DISP=SHR
//IN2 DD DSN=CAB55.TEST.SORT2,DISP=SHR
//T1  DD DSN=&&T1,DISP=(MOD,PASS),UNIT=SYSDA,SPACE=(TRK,(5,5))
//COMBINE DD DSN=CAB55.TEST.MATCHING,DISP=SHR
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(COMBINE) ON(5,9,ZD) WITH(30,16)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(45:X)
/*
//CTL2CNTL DD *
  INREC BUILD=(1,13,30:14,16)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post