RPGIV @ Work

A unique site for RPG and System i Lovers


Hi, this site will provide all what you need in System i and RPG developments.

My Name is Chamara Withanachchi, System i Expert and RPG Developer. And in the field for last 11 years.

I hope you will find lot of valuable information from this site

EXTFILE or Redirecting Files Print E-mail
User Rating: / 1
Written by Chamara Withanachchi   

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:


You cannot specify *CURLIB as the library name.
If you specify a file name without a library name, *LIBL is used.
The name must be in the correct case. For example, if you specify EXTFILE(varFileName) and variable varFileName has the value 'qtemp/myfile', the file will not be found. It should have the value 'QTEMP/MYFILE'.
This keyword is not used to find an externally-described file at compile time.
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:
Using the INZ keyword on the D specification
Passing the value in as an entry parameter
Using a program-global variable that is set by another module.


     Finput     if   E             disk    extfile(varFileName)

     Finput     if   E             disk    extfile('LIBNAME/FILENAME')
     Finput     if   E             disk    extfile('FILENAME')

     Finput     if   E             disk    extfile('*LIBL/FILENAME')
<Previous   Next>