COPYEXT

Specifies the filename extension of the copybook that the Compiler is to look for if a filename in a COPY statement is specified without an extension.

Syntax:

                             +-----------------+
                             V                 |
>>-.---.--COPYEXT-"extension-.-.-------------.-.--"--><
   +-/-+                       +-,-extension-+

Parameters:

extension A filename extension.

Properties:

Default: COPYEXT"cbl,CPY" (Windows) or COPYEXT",cbl,cpy" (UNIX)
Phase: Syntax check
$SET: Initial

Dependencies:

DIALECT"RM" sets COPYEXT",cbl,CBL" immediately.

Comments:

Up to 25 extensions can be specified, each extension being up to 10 characters long. A null extension is used to represent an extension of spaces; for example:

COPYEXT"src,,txt"
COPYEXT"cpy,cbl,cob,abc,"

If the filename specified in a COPY statement has no extension or trailing period, the list of possible extensions is tried in turn until a file is successfully found or the list is exhausted (and an error reported).

If you have many COPY statements that do not specify an extension, using COPYEXT can improve the compilation speed of your program. For example, if all of your copybooks have the filename extension .cpy, specifying COPYEXT"CPY,CBL" would avoid unnecessary file access attempts.

If you are running programs migrated from the mainframe, make sure that you set COPYEXT to find upper-case extensions as well as lower-case (applies to UNIX environments only).