× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



> From: David Gibbs
> 
> In the spirit of peer review ... could you post the source code for
the
> test programs?

Fill the file with 800,000 records (use a write loop).  Then add keys
with the following SQL (see, I know when to use SQL! <grin>):

UPDATE J4PP1 SET KEY1 = CHAR(RRN(J4PP1))

Joe


DDS: 

A          R J4PP1R               
A            KEY1          10     
A            KEY2          10  0  
A            DATA1        128     
A            DATA2         15  0  
A          K KEY1                 
A          K KEY2                 


NATIVE:

fj4pp1     if   e           k disk                 
                                                   
d x               s             10  0              
d rptr            s             10  0              
d count           s             10  0              
d counti          s             15  5              
d rseed           s             15  5              
d time1           s              6  0              
d time2           s              6  0              
d msg             s             50                 
                                                   
d mykey           s                   like(KEY1)   
                                                   
c     *entry        plist                          
c                   parm                    counti 
c                   parm                    rseed  
 *                                                                     
c                   time                    time1                      
 *                                                                     
c                   eval      count = counti                           
c                   eval      rptr = rseed                             
c                   for       x = 1 to count                           
c                   eval      rptr = %rem(rptr + 1237 : 800000) + 1    
c                   eval      mykey = %char(rptr)                      
c     mykey         chain     j4pp1r                                   
c                   endfor                                             
 *                                                                     
c                   time                    time2                      
c                   eval      msg = %char(time1) + ' ' + %char(time2) +
c                             ' ' + %char(count)                       
c                   dsply                   msg                        
 *                                                                     
c                   eval      *inlr = *on                              


SQL:

d j4pp1         e ds                  inz          
                                                   
d x               s             10  0              
d rptr            s             10  0              
d count           s             10  0              
d counti          s             15  5              
d rseed           s             15  5              
d time1           s              6  0              
d time2           s              6  0              
d msg             s             50                 
                                                   
c     *entry        plist                          
c                   parm                    counti 
c                   parm                    rseed  
 *                                                 
c                   time                    time1  
 *                                                 
c                   eval      count = counti                           
c                   eval      rptr = rseed                             
c                   for       x = 1 to count                           
c                   eval      rptr = %rem(rptr + 1237 : 800000) + 1    
c                   eval      mykey = %char(rptr)                     
c/EXEC SQL select * into :j4pp1 from j4pp1 where key1 = :mykey         
c/END-EXEC                                                             
c                   endfor                                             
 *                                                                     
c                   time                    time2                      
c                   eval      msg = %char(time1) + ' ' + %char(time2) +
c                             ' ' + %char(count)                       
c                   dsply                   msg                        
 *                                                                     
c                   eval      *inlr = *on                              


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.