When you create a template from a COBOL copybook, File
Manager must compile the copybook as one step in the process of creating
the template. When your COBOL copybook has a COPY command with a REPLACING
clause, you might see a compile failure when attempting to create
the template.
This compile failure is caused by, in most cases, File Manager
inserting your COBOL copybook into a simple COBOL program using a
COPY statement. The COPY command with a REPLACING clause in your copybook
becomes nested in another COPY statement. Nested COPY commands with
REPLACING clauses are illegal in COBOL, and the compile error results.
However, when you specify a range in advanced copybook selection,
the selected portion of the copybook is copied inline into the simple
COBOL program, rather than being inserted using a COPY statement.
Therefore, the COPY command with the REPLACING clause would not be
nested and the compile would complete successfully.
To successfully create a template with a COBOL copybook containing
a COPY command with a REPLACING clause:
- Be sure to place the copybook and nested copybooks into the same
PDS.
- Choose "Advanced copybook template" in the Create Template" wizard.
- Edit the copybook selection to specify a range (specifying a "From
statement" of 1 and leaving the "To statement" blank selects the entire
contents of the copybook).