Compare multipe records in a single file



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

Re: Compare multipe records in a single file

Postby ragsara » Wed Feb 26, 2014 8:41 pm

Hi Kolusu,

Yes we are sticking with 3 keys.
ragsara
 
Posts: 23
Joined: Thu Mar 22, 2012 5:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare multipe records in a single file

Postby skolusu » Thu Feb 27, 2014 12:45 am

Use the following DFSORT JCL which will give you the desired results. I assumed that your input has RECFM=FB and LRECL=302. If you have different lrecl then make sure that you change M1F1CNTL to reflect the end position+1 where I am normalizing the free format key. Also change the positions in CTL2CNTL for JOINKEYS for F1.

Please get rid off the DCB parameters in your JCL as DFSORT can automatically calculate them for you.
//STEP0100 EXEC PGM=ICETOOL     
//TOOLMSG  DD SYSOUT=*           
//DFSMSG   DD SYSOUT=*           
//IN       DD DISP=SHR,DSN=Your Input FB 302 Byte file
//T1       DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)       
//OUT      DD SYSOUT=*                                           
//TOOLIN   DD *                                                   
  SELECT FROM(IN) TO(T1) ON(1,11,UFF) USING(CTL1) ALLDUPS         
  COPY JKFROM TO(OUT) USING(CTL2)                                 
//*                                                               
//CTL1CNTL DD *                                                   
  OPTION DYNALLOC=(SYSALLDA,50)                                   
                                                                 
  INREC BUILD=(003,11,          $ KEY                             
               198,35,          $ FNAME                           
               293,10)          $ DOB                             
                                                                 
  SORT FIELDS=(01,11,UFF,A,                                       
               12,35,CH,A,                                       
               47,10,CH,A)                                       
                                                                 
  SUM FIELDS=NONE                                                 
  OUTFIL FNAMES=T1,                                               
  IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,11),PUSH=(58:12,45))             
//*                                                               
//CTL2CNTL DD *                                                   
  OPTION DYNALLOC=(SYSALLDA,50)                                   
  JOINKEYS F1=IN,FIELDS=(303,11,A),TASKID=M1                     
  JOINKEYS F2=T1,FIELDS=(001,11,A),SORTED,NOSEQCK,TASKID=M1       
  REFORMAT FIELDS=(F1:1,302)                                     
//*                                               
//M1F1CNTL DD *                                                     
  INREC OVERLAY=(303:3,11,UFF,M11,LENGTH=11)                       
//*                                                                 
//M1F2CNTL DD *                                                     
  OMIT COND=((12,45,CH,EQ,58,45,CH),OR,                             
             ((12,35,CH,EQ,58,35,CH),AND,(47,10,CH,NE,93,10,CH)),OR,
             ((12,35,CH,NE,58,35,CH),AND,(47,10,CH,EQ,93,10,CH)))   
                                                                   
  INREC BUILD=(1,11,UFF,M11,LENGTH=11)                             
//* 
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Compare multipe records in a single file

Postby ragsara » Thu Feb 27, 2014 9:32 pm

Hi Kolusu,

I have just got one line to say for you "YOU ARE AWESOME".

It worked perfectly and am blessed to learn more such things from you.

I have commited few erorrs during this testing , hope you will forgive me.

Thank you and have a great day :)
ragsara
 
Posts: 23
Joined: Thu Mar 22, 2012 5:17 pm
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post