RPG – Qualified Data Structures

d CustomerDS      DS                  Dim(50) qualified   
d  Number                             like(csnum)         
d  Postcode                           like(cspcde)        

d x               s              5s 0                     

 /free                                                    
    SetLL *loval iccust01;                   
    Read  iccust01;                                       
    x = 1;                                                
    Dow not %eof(iccust01);                               
       CustomerDS(x).Number    = csnum;             
       CustomerDS(x).Postcode  = cspcde;            
       x += 1;
       Read  iccust01;                   
    EndDo;  
/end-free