In COBOL, a copybook file is used to define data elements that can be referenced by many programs. When the Declaration Generator creates a declaration for a COBOL program, it writes it to a copybook file (.cpy file).
To create a COBOL copybook, start the Declaration Generator utility, then follow the steps below:
If you don't specify a path, the copybook is written to the first directory specified in the COBCPY environment variable. If this variable isn't found, the copybook is written to the current application path (the application path is specified in the PATHS tab in Options).
If you specify a file that already exists, you are given the choice of appending to it or overwriting it at run time.
EMP-lname PIC X(15)
EMP-fname PIC X(10)
EMP-dept PIC X(12)
.
.
.
Remember the COBOL variable-naming guidelines when assigning a prefix. Do not assign one containing characters that are disallowed by the compiler or one that might make the elementary item name too long.
EMP-001 PIC X(15)
EMP-002 PIC X(10)
EMP-003 PIC X(12)
.
.
.
| For this option... | Specify... |
|---|---|
| Level | The level number you want assigned to the record description. If you leave this field blank, Level 1 is assigned. |
| Graphic Type | The PIC type you want to use for graphic, vargraphic and long vargraphic fields in the table. |
| Page Size | The page size you want assigned to long varchar, long vargraphic, and long varbinary fields. |