Sequence Number Problem



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

Re: Sequence Number Problem

Postby skolusu » Thu Oct 11, 2012 9:18 pm

Mayank & Bill,

Unless I am thick and my brain isn't working, are you both getting the correct results? I mean shouldn't you be incrementing the seqnum for every 50 records within the key?? Lets say for example you have a key ABC and you have 168 records of ABC. So key 51,101 & 151 should be 2,3,4 . with your code , the first set is 50 and the next sets are 51 ,52... and so on.

Run the following test data as sample with your control cards and check the records 51,101,151,152 .... within each key.

//STEP0050 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
ABC                                                             
DEF                                                             
EFG                                                             
//SORTOUT  DD DSN=&&IN,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)     
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  OUTFIL REPEAT=168                                             
//*


The following control cards will give you the sequence number with increment for every 50 records within the key. You don't even need IFTHEN. The trick here is to start the seqnum with the value we want to divide with. In this case it is 50. so start the seqnum with 50.
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                       
  INREC OVERLAY=(10:SEQNUM,5,FS,START=50,RESTART=(1,3),   
                 10:10,5,FS,DIV,+50,FS,LENGTH=5)         
//*
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: Sequence Number Problem

Postby Mayank[123] » Fri Oct 12, 2012 11:12 am

Thanks Kolusu...
Mayank[123]
 
Posts: 14
Joined: Thu Oct 11, 2012 11:58 am
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post