Setll *HIVAL and *LOVAL

247 Views


*HIVAL and *LOVAL

*LOVAL is an RPG figurative constant that can be specified as the value of the definition specification keyword INZ or the search-argument operand of operation code SETLL or SETGT. 

 

Using SETLL with *LOVAL positions the file so that the first read retrieves the record with the lowest key.

 

Setll *loval  filename;      
Read filename;               
Dow not %eof(filename);      
 If %found(filename);   

 //Some Code
     
 Endif;       
 Read filename;
Enddo;    

-----------------------------------

 Setll *Loval FileName;                         
 If not %Found();                             
   Msg  = 'No record Present in file'; 
 EndIf;    

----------------------------------
Setll *Loval FileName;  
  Read FileName;         
   If Not %Eof(FileName) 

   EndIf;

 

Be careful when using SETLL *LOVAL on keyed access paths containing numeric key fields. 

Don't Be Misled by SETLL *LOVAL

Post Comments