Sekar
Sekar

Reputation: 387

RPGLE Externally Described Data Structures

I have used externally described data structures in the past to use file fields. Now when i debug the data structure is blanks. I cannot recollect if i have missed anything. Please assist.

H option(*nodebugio) cvtopt(*datetime)                           
FEMPMSTP   IF   E           K disk    prefix(A_)                 
D empDs         E DS                  extname(EMPMSTP) prefix(A_)

           dou %eof(EMPMSTP);                                    
               read EMPMSTP;                                     
               if %eof;                                          
                  leave;                                         
               endif;                                            
           enddo;                                                

           *inlr = *on;    

After the read statement the empDs is to have the value of the record that was read.

Upvotes: 0

Views: 1929

Answers (1)

Charles
Charles

Reputation: 23783

The RPGLE compiler is pretty smart. It knows you aren't using any of the data from the file...

Try adding..
h debug(*input)

Note that the behavior changed, read got smarter, in 6.1. So that might be why this is new to you now.

More info in a post from Barbara Morris of IBM's compiler team here: https://www.ibm.com/developerworks/community/blogs/b542d3ac-0785-4b6f-8e53-f72051460822/entry/are_you_using_option_nounref_if_so_good_if_not_read_on?lang=en

Upvotes: 2

Related Questions