MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » May 2014

Re: Reading source files in RPGLE



fixed

Barbara

Many thanks for this - for some reason I wasn't alerted to your post so
hadn't responded earlier.

I didn't seem to be able to do this in V5R1 - is it supported?

I had posted that I had managed to solve the problem in my last post.

Many thanks



On 21 May 2014 17:01, Barbara Morris <bmorris@xxxxxxxxxx> wrote:

On 2014-05-19 14:19, Rob Dixon wrote:

I haven't needed to read a source file for about 24 years and didn't have
any problems reading them with OPM RPG.

Now I need to do it again and am using RPGLE. I can open the file and
read
records but the fields are all empty. I must be doing something pretty
dumb. I am on V5R1. Can anyone help please? I have tried with both
externally described and program described files.


If you don't use the fields in your program, the compiler makes an
optimization and doesn't move the data from the input record into the
fields.

You can code DEBUG(*INPUT) in your H spec to get it to always load fields
even if they are not used in the program.

Here's a page in the Programmer's Guide "Unexpected Results when
Evaluating Variables"
http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_72/
rzasc/dbgunexp.htm

Here's the page in the Reference about DEBUG(*INPUT):
http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_72/
rzasd/hdebug.htm

--
Barbara


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.









Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact