× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Barbara

Thank you, that was exactly it. I had commented out the write from the old file and not added in the write for the new file. A few of us were looking and all missed it :)

All the best
Jonathan


-----Original Message-----

------------------------------

message: 5
date: Thu, 25 Aug 2016 08:24:18 -0400
from: Barbara Morris <bmorris@xxxxxxxxxx>
subject: Re: External File Fields Not Being Imported to SQLRPGLE
program

On 8/25/2016 7:54 AM, Jonathan Mason wrote:

I have a program that has been modified to replace a file defined for
output with a different file as shown in the following F-specs:

FF0011 O E Disk JDE1
F ExtDesc('F0011PF') ExtFile(*ExtDesc)
..
However, when I attempt to compile the program I receive an RNF7030
Undefined field error for every field from the file that is being
populated. ...

If I change the specification for F03B13Z1PF to be Input with Add and
force the import of the field definitions then the program compiles
normally.

RPG has a "feature" where it only generates the O specs for a record if
the record appears on a WRITE statement, or if there are any
subprocedures in the module. If it's an output only file, the fields get
defined when the O specs get generated.

(I'm never sure if this feature was intended as an optimization, or if
it was more of an oversight when RPG first got externally-described
files back in System-38 days.)

If you don't want to add a WRITE operation to the record, you could add
an O spec for the record:

OmyFmt e

or a blank P spec:

P
--
Barbara



------------------------------

message: 6
date: Thu, 25 Aug 2016 11:54:50 -0400
from: Barbara Morris <bmorris@xxxxxxxxxx>
subject: Re: External File Fields Not Being Imported to SQLRPGLE
program

On 8/25/2016 8:24 AM, Barbara Morris wrote:
...
RPG has a "feature" where it only generates the O specs for a record if
the record appears on a WRITE statement, or if there are any
subprocedures in the module. ...

Just for completeness, I should have said that the compiler generates
the O specs if the record appears on a WRITE or UPDATE statement. If the
file is defined for update, the O specs aren't needed for defining the
fields, since they would be defined by the I specs.

--
Barbara




------------------------------

End of RPG400-L Digest, Vol 15, Issue 429
*****************************************


Proud partner of The Ageas Bowl and the Ageas Salisbury International Arts Festival.

Registered Address: Ageas House, Hampshire Corporate Park, Templars Way, Eastleigh, Hampshire, SO53 3YA Registered Number: 354568 England

Authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and the Prudential Regulation Authority

This e-mail together with any attachments are intended for the addressee only and may be private and confidential. If you are not the intended recipient, or the person responsible for delivering it to the intended recipient, you must not open any attachments, or copy, disclose, distribute, retain or use this e-mail, including any attachments, in any way whatsoever; please return it to us immediately using the reply facility on e-mail.

Consider the environment and think before you print this email.


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.