Page 1 of 1

ICETOOL: Matching Records for VB Files

PostPosted: Thu Nov 20, 2008 3:39 am
by anil4321
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)
/*

Re: ICETOOL: Matching Records for VB Files

PostPosted: Thu Nov 20, 2008 4:12 am
by Frank Yaeger
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)
/*