You have two ways to indicate where /COPY and /INCLUDE files can be found in the IFS:
For Example: ADDENVVAR ENVVAR(RPGINCDIR) VALUE('/home/mydir:/project/prototypes')ADDENVVAR
When searching for a relative file in the IFS (one whose path does not begin with /), the file will be searched for in the following places, in this order
For example, if:
The directory search path takes precedence over the default-suffix order. If a file with no extension is searched for in several different directories, all suffixes will be tried in each directory before the next directory is tried.
| /Copy statement | Files searched for |
|---|---|
|
Assume the source file containing the /COPY is /driver/src/main.rpg, in the IFS /COPY file.rpg |
In IFS: /home/auser/file.rpg /driver/v5r2/inc/file.rpg /driver/v5r1/inc/file.rpg /home/auser/temp/file.rpg /home/auser/src/file.rpg In QSYS: FILE(*LIBL/QRPGLESRC) MBR(FILE.RPG) |
|
Assume the source file containing the /COPY is MYLIB/QRPGLESRC MYMBR, in the QSYS file system /COPY file |
In QSYS: FILE(*LIBL/QRPGLESRC) MBR(FILE) In IFS: /home/auser/file /home/auser/file.rpgleinc /home/auser/file.rpgle /driver/v5r2/inc/file /driver/v5r2/inc/file.rpgleinc /driver/v5r2/inc/file.rpgle /driver/v5r1/inc/file /driver/v5r1/inc/file.rpgleinc /driver/v5r1/inc/file.rpgle /home/auser/temp/file /home/auser/temp/file.rpgleinc /home/auser/temp/file.rpgle /home/auser/src/file /home/auser/src/file.rpgleinc /home/auser/src/file.rpgle |