Midrange News for the IBM i Community


Posted by: John Tremper
LF with date key in descending order
has no ratings.
Published: 04 Jan 2013
Revised: 23 Jan 2013 - 1979 days ago
Last viewed on: 25 Jun 2018 (6710 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

LF with date key in descending order Published by: John Tremper on 04 Jan 2013 view comments(13)

I'm worried I may be stuck on a rookie mistake, but here goes.  I have a physical file with the following keys:

K INSCO                             

K EFFDATE                           

K ACTION                            

K DATEADDED                         

K TIMEADDED                         

K DATECHANGE                        

K TIMECHANGE                        

and a logical on that physical that looks like this:

K INSCO                                                    

K EFFDATE                   DESCEND                        

O ACTION                    CMP(EQ 'B')                    

My interactive RPG program has this key list:

fsKey2        klist                                      

              kfld                    insco              

              kfld                    effect_date        

And the read looks like this:

              eval      effect_date = *hival                         

fsKey2        chain     fsstandl2                                    

              readp     fsstandl2                              95    

              if        not %found(fsstandl2)                        

              eval      errorLine = 'No Rates Found'                 

              else                                                   

              clear                   errorLine                      

              endif                  

The file contains 2 records and the read should be finding them, but it isn't.  I know I am missing something simple, but I have been looking at this chunk for 2 days with no positive results.

 

Thanks in advance!                              

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS