How FM/Db2 compiles a copybook into a template
If you specify a copybook, FM/Db2 performs the following steps:
- Checks (if the compiler language selected is not HLASM) whether the copybook is a complete source program, or contains only COBOL data declarations or PL/I DECLARE statements. If the copybook is not a complete program, FM/Db2 includes the copybook in a shell program.
- Calls the selected compiler to check the syntax of the copybook,
and to produce an ADATA file.
You can use the Settings: Compiler language selection panel (option 0.0.4) to specify whether FM/Db2 calls the COBOL, HLASM, or PL/I compiler.
For COBOL and PL/I copybooks, you can select the Auto detect option on the Compiler Language Selection panel to instruct File Manager to detect the language of the copybook and call the appropriate compiler. In this case, FM/Db2 analyzes the source to determine whether the language of the source is COBOL or PL/I and creates a template based on the result.
To instruct File Manager to process an Assembler copybook, you must set the language option on the Compiler Language Selection panel to HLASM. Once you have set the option to HLASM, every function that supports copybooks can be used with an Assembler copybook. Use the HLASM compiler specifications to provide extra SYSLIB and change ALIGN and DBCS processing options.
You can specify the acceptable return code level for the compilation in the compiler specifications panel for the selected language.
If the compilation produces a return code with a value less than or equal to the specified maximum, FM/Db2 processes the information in the ADATA file to create a template.
If the compilation produces a return code with a value greater than the specified maximum, FM/Db2 displays a pop-up menu. From the pop-up menu, you can:- View the compilation listing using Print Browse (option 3.11).
- Cancel the template creation process.
- Try the compilation again. Before you select this option, first view the compilation listing and correct any errors in the copybook. While you are viewing the compilation listing, you can use the ISPF split screen facility to swap to another ISPF session and use your editor to correct the errors in the copybook.
- Ignore the errors and proceed with creating the template. This option is only available if FM/Db2 is able to create a template. Some compilation errors, such as warnings, might have no effect on the creation of the template. If you are unsure, view the compilation listing. If the compilation error is too severe, FM/Db2 cannot create a template.
- Try the compiler for the other language. The option is not available if the HLASM compiler language has been selected.
Related tasks
Related references