Page 3 of 3

Re: ICETOOL - compare 2 input files

PostPosted: Thu Oct 18, 2012 10:30 pm
by skolusu
bittybit,

Use the following DFSORT JCL which will give you the desired results. We expanded the 8 byte PD field to 16 bytes using HEX function and then we use the first 13 bytes for matching.

//STEP0100 EXEC PGM=SORT           
//SYSOUT   DD SYSOUT=*             
//INA      DD DSN=Your Input VB file1,DISP=SHR
//INB      DD DSN=Your Input VB file2,DISP=SHR
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *                   
  OPTION COPY                     
  JOINKEYS F1=INA,FIELDS=(5,13,A) 
  JOINKEYS F2=INB,FIELDS=(5,13,A) 
  REFORMAT FIELDS=(F1:1,4,21)     
//*                               
//JNF1CNTL DD *                   
  INREC BUILD=(1,4,55,8,HEX,5)     
//*                               
//JNF2CNTL DD *                   
  INREC BUILD=(1,4,55,8,HEX,5)     
//*

Re: ICETOOL - compare 2 input files

PostPosted: Thu Oct 18, 2012 11:38 pm
by bitbybit
Hi Kolusu,
1. in "FIELDS=(5,13,A)" is that "A" is for to tell the input file is in Asc order or to sort the o/p in asc order? My input files are in desc order by that key?
2. I want the o/p to be sorted Asc by the full acct# fld - s9(15) comp-3
3. can u pls explain what's that "REFORMAT FIELDS=(F1:1,4,21)" does?

Re: ICETOOL - compare 2 input files

PostPosted: Thu Oct 18, 2012 11:42 pm
by BillyBoyo
1. Not the output, but for the JOIN itself.
2. You say the first 13 are unique in the file, so it should be in that order without having to sort on the remainder.
3. Since the HEX value is no longer required, and since you variable-length data starts at 21, it now says 21 instead of 5.

Re: ICETOOL - compare 2 input files

PostPosted: Thu Oct 18, 2012 11:56 pm
by bitbybit
yes...that 13 byte (key) is unique for each input file. and both files are sorted in desc by whole 15 byte fld. I need my o/p to be sorted on that 15 byte, but in Asc order....I just ran my test file with the above code and it worked and the o/p is in sort order asc by 15 byte. I will increase test data and see what happens....Thank you both for your help.