Hello Joel,

You wrote:
>After EVERY read I get the same MLNAM and MMAP (both fields from cafpmast), 
>so I never get out of the loop.  How can this be???  

Simple. You never check for EOF thus when it occurs (on the second read) the 
buffer still contains the data from the previous successful read.

>dow MLNAM = NAMEIN;  // DOW so priming read (or similar) occurred previously
>  if MMAP = LASTMAP; // Obviously never occurs else LEAVE would work
>    read cafpmast;  
>    leave;          
>  endif;            
>  read cafpmast;      // EOF occurs but not checked so loop again. Oops!
>enddo;              

>MLNAM is the field from the file and there is only one record in the file 
>with this name.  In debug I can see the read statement processing, but it 
>never moves to the next record, so the field value cannot change.

It never moves to the next record because there isn't one. You said the file 
contains one record therefore the next read will get EOF but you don't check 
that so you enter and endless loop processing the same data ad infinitum.

Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists       
                                                                  
   http://www.flybynight.com.au/                                  
   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\   
   Fax:   +61 3 9419 0175   mailto: shc@xxxxxxxxxxxxxxxxx   \ /   
                                                             X    
                 ASCII Ribbon campaign against HTML E-Mail  / \   
--------------------------------------------------------------------


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.