Difference b/n Chain and Setll reade

54 Views


Difference between Chain and Setll reade

  • The CHAIN command does a SETLL and a READE in order to find a match. CHAIN is best used to locate a unique record (like a customer record).
  • SETLL with READE is best used when there can be more than one record found. For example, you can find multiple customer orders in your system for one unique customer.
Setll (Field1 : Field 2) FileName;
Read FileName;                              
Dow Not %EOF(FileName);  
     
     //Some Logic
                  
     Reade FileName;   
 
Enddo;

 

Chain ( parm_DS.Nbr                                                  
      : parm_DS.Seq)               // Keys                  
      filename                     // File                  
      ds_filename_IO;              // Input DS              
                                                                                        
If %found(filename);
   parm_filename_DS = ds_filename_IO;                                                                    
   Success = *On;                                                               
Endif;

Refer below link for more infor:

go4as400

Post Comments