The /COPY and /INCLUDE directives allow the specification of files in either the QSYS file system or the IFS file system. In cases where the compiler cannot tell which file system the directive refers to, the search will begin in the file system of the file containing the /COPY directive.
When the compiler encounters a /COPY statement, the statement could refer to a file in the IFS or in the QSYS file system. If the name begins with a slash or is specified in single quotes, the name can only refer to a file in the IFS. A name in the IFS can be specified in double quotes as well. Where only part of the name is in double quotes, for example:
/copy "SOME-LIB"/QRPGLESRC,MBR
the name can only be a QSYS file system name.
If the name could be either in the QSYS file system or the IFS, the file system of the file containing the /COPY statement will be searched first. Note that upper-casing occurs for the QSYS file system (except with extended names specified with double quotes, such as "A/B") but not for the IFS. (The IFS is not case sensitive.)
/Copy statement | QSYS interpretation | IFS interpretation (see below for the meaning of ".suffix") |
---|---|---|
/COPY MYMBR |
FILE(*LIBL/QRPGLESRC) MBR(MYMBR) |
MYMBR or MYMBR.suffix in one of the directories in the include path |
/COPY mymbr |
FILE(*LIBL/QRPGLESRC) MBR(MYMBR) |
mymbr or mymbr.suffix in one of the directories in the include path |
/COPY myfile,mymbr |
FILE(*LIBL/MYFILE) MBR(MYMBR) |
myfile,mymbr or myfile,mymbr.suffix (note that MYFILE,MYMBR is a valid name in the IFS file system) |
/COPY mylib/myfile,mymbr |
FILE(MYLIB/MYFILE) MBR(MYMBR) |
mylib/myfile,mymbr (directory mylib and file myfile,mymbr) |
/COPY "A/b",mymbr |
FILE(*LIBL/"A/b") MBR(MYMBR) |
n/a (only part of name is in double quotes |
/COPY "A/B" |
FILE(*LIBL/QRPGLESRC) MBR("A/B") |
A/B |
/COPY a b |
FILE(*LIBL/QRPGLESRC) MBR(A) (everything after a blank is assumed to be a comment) |
a or a.suffix (everything after a blank is assumed to be a comment) |
/COPY 'a b' | N/A (name in single quotes) | a b or a b.suffix |
/COPY /home/mydir/myfile.rpg | N/A (name begins with slash) | /home/mydir/myfile.rpg |
/COPY /QSYS.LIB/ L.LIB/F.FILE/M.MBR |
N/A (name begins with slash) |
/QSYS.LIB/L.LIB/F.FILE/ M.MBR (which is actually a file in the QSYS file system, but is considered to be an IFS file by RPG) |