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



If overriding the file is your main intent, why not override it in the file 
spec using EXTFILE key word. You can use a variable to manipulate the file name 
or a constant if it's always the same file.

Here's what it says in the manual:
EXTFILE(filename)
The EXTFILE keyword specifies which file, in which library, is opened. The value
can be a literal or a variable. You can specify the value in any of the 
following
forms:
filename
libname/filename
*LIBL/filename
Notes:
1. You cannot specify *CURLIB as the library name.
2. If you specify a file name without a library name, *LIBL is used.
3. The name must be in the correct case. For example, if you specify
EXTFILE(filename) and variable filename has the value ’qtemp/myfile’, the file
will not be found. Instead, it should have the value ’QTEMP/MYFILE’.
4. This keyword is not used to find an externally-described file at compile 
time.
5. If a variable name is used, it must be set before the file is opened. For 
files that

are opened automatically during the initialization part of the cycle, the 
variable
must be set in one of the following ways:
v Using the INZ keyword on the D specification
v Passing the value in as an entry parameter
v Using a program-global variable that is set by another module.
If you have specified an override for the file that RPG will open, that 
override will
be in effect. In the following code, for the file named INPUT within the RPG
program, the file that is opened at runtime depends on the value of the filename
field.
Finput if f 10 disk extfile(filename)
If the filename field has the value MYLIB/MYFILE at runtime, RPG will open the
file MYLIB/MYFILE. If the command OVRDBF MYFILE OTHERLIB/OTHERFILE
has been used, the actual file opened will be OTHERLIB/OTHERFILE. Note that
any overrides for the name INPUT will be ignored, since INPUT is only the name
used within the RPG source member.


--
CD Salas Jr.
Costco Wholesale Central
Issaquah, WA 98027

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.