Identifying COBOL copybooks and programs

When you import existing COBOL sources into Visual COBOL, the IDE scans each imported file to determine whether it is a COBOL program or a copybook. Based on the settings specified in Window > Preferences > Micro Focus > COBOL > Directives Determination, the IDE sets Compiler directives only on the files identified as COBOL programs.

In certain situations, the IDE may identify a COBOL program as a copybook (or vice versa); this could mean that the appropriate Compiler directives are not set on a file incorrectly identified as a copybook, which could cause a project compilation failure. In such cases, you can use the Transform Copybook to Program and Transform Program to Copybook context menu commands to manually indicate the correct file type.

Note: It is not possible to transform files with a .cpy extension, as they are always copybooks, or files with a .cob extension as they are always COBOL programs. Files with a .cbl extension may be either COBOL programs or copybooks.

To indicate that a file is a COBOL program:

Alternatively, you can do one of the following:

To indicate that a file is a copybook:

Alternatively, you can do one of the following: