Skip to main content

Problem:

Release: 3.1   Each COPY statement in your program identifies a copyfile to be copied.  If the filename in the COPY statement is incomplete, because it lacks either an extension or a path, the Compiler searches for it as follows:

Resolution:

1. In the directory given by the COPY library-name. Note that if the name of the copy file is a qualified filename, that is, it     includes the path or directory, the Compiler searches that directory only

2. In the directory containing the main source program being compiled

3. In any directories listed in the COBCPY environment variable, in the order specified

If the COPY statement does not give the extension of the copyfile's filename, the Compiler searches for files with extensions given by the directives OSEXT and COPYEXT.

You can set the COBCPY environment variable from each project as follows:

1. Go to Project > Properties > Environment's IDE

2. Type in COBCPY from the Variable's field

3. Type in your copyfiles' directories from the Value's field (separating each directory with a semi-colon and  concatenating the existing value of COBCPY if applicable; e.g.    d:\\dir1;d:\\dir2;%cobcpy%)

4. Click on the Set button

Old KB# 6837