× 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.



The EXTFILE eliminates the need to do a RUN-TIME OVRDBF. EXTDESC
eliminates the need of a COMPILE-TIME OVRDBF.

For example, lets say you wanted to bring the same file in twice within the
same program. Obviously, you can't put FILEA in the FSPEC twice. It will
not compile. So you would normally put a bogus file name in the FSPEC i.e.
FILEA@.

Before EXTFILE, you would have to OVRDBF FILE(FILEA@) TOFILE(FILEA) in a CL
prior to calling the program, and you also had to do it to prior to
compling the program.

With EXTFILE, you no longer needed the OVRDBF in a CL prior to calling the
program, however, you did in order to compile.

Now with EXTDESC, you no longer need to do OVRDBF when compiling now too.
EXTDESC will look at the value within it and pull in those fields to
compile with.

Typically you will see EXTDESC(*EXTFILE) EXTFILE('LIB2/FILEA') in the
keywords


On Tue, Mar 20, 2012 at 11:25 PM, John Yeung <gallium.arsenide@xxxxxxxxx>wrote:

Any time you can use a variable instead of a hard-coded value, that's
a significant gain in flexibility. One simple convenience the EXTFILE
keyword provides is the ability to do what amounts to OVRDBF, but
without a separate CLP.

In principle, you can actually do much more powerful things, like get
user input within your RPG program, and have that very same program
choose different files to open (so long as their record formats are
compatible) based on that user input. I don't know if there was a way
to choose a file at run-time before the EXTFILE keyword (V5R1), but
even if there was, it was surely much more difficult and convoluted.

EXTDESC is even newer, and is comparatively less powerful. It's a
convenience, saving you from having to have the compile-time file with
the proper name in the proper place in the library list. For example,
suppose you have four existing files: LIB1/FILEA, LIB1/FILEB,
LIB2/FILEA, and LIB2/FILEB. LIB1/FILEA is not compatible with
LIB2/FILEA and LIB1/FILEB is not compatible with LIB2/FILEB. If your
program needs to be compiled with LIB1/FILEA and LIB2/FILEB, it is
much trickier (or at least much more annoying) to accomplish without
the EXTDESC keyword.

John
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.