Including declarations from DCLGEN in a DUMMY COBOL program

About this task

ADDI saves SQL fields that are used in COBOL programs. During the build process, the SQL fields that are used from COBOL are saved by parsing the DECLARE TABLE statement. Therefore, this process relies on DCLGEN copybooks and the DECLARE TABLE statement must be included in these copybooks.

To correctly collect the SQL fields and map the fields to the variables, the COBOL declaration for table must be included in the IBM® ADDI Build project.

Procedure

  1. When the DCLGENs are not embedded in COBOL copybooks, create a DUMMY COBOL program and include all the DCLGEN files in the program.
  2. Name the COBOL program to ensure that the DECLARE TABLE statements are built first.
    Note: IBM ADDI Build Client build process works alphabetically on source files, so you need to name the program like AAAAAAAA or 0DUMMYDCL.
  3. Code the following statements in your COBOL program.
    Note: If the files generated with DCLGEN tool are called Copybook1, Copybook2 and Copybook3, then the new COBOL program must resemble the following:
    COPY Copybook1.
    COPY Copybook2.
    COPY Copybook3.
    ...
    Note: The COBOL program must be a minimal yet valid, incorporating the new COPY statements within the Working-Storage section.
    Note: The newly generated copybooks must be added within the project in the virtual folder or to the physical folder containing other copybooks for this project, provided that the new copybooks do not have new file-extensions different than the existing ones.
  4. Add the COBOL program to the IBM ADDI Build project.

Results

After you use DCLGEN to produce declarations for tables, views, and variables for your COBOL program, these declarations will be included in your IBM ADDI Build project.