Precompile panel

After you set the DB2I defaults, you can precompile your application. You can reach the Precompile panel by specifying it as a part of the program preparation process from the Db2 Program Preparation panel. Or you can reach it directly from the DB2I Primary Option Menu.

The way you choose to reach the panel determines the default values of the fields it contains. The following figure shows the Precompile panel.

Figure 1. The Precompile panel. Specify the include library, if any, that your program should use, and any other options you need.
 DSNETP01                     PRECOMPILE                       SSID: DSN
 COMMAND ===>_
 
 Enter precompiler data sets:
  1  INPUT DATA SET .... ===> SAMPLEPG.COBOL
  2  INCLUDE LIBRARY ... ===> SRCLIB.DATA
 
  3  DSNAME QUALIFIER .. ===> TEMP        (For building data set names)
  4  DBRM DATA SET ..... ===>
 
 Enter processing options as desired:
  5  WHERE TO PRECOMPILE ===> FOREGROUND  (FOREGROUND, BACKGROUND, or EDITJCL)
  6  VERSION ........... ===>
                                          (Blank, VERSION, or AUTO)
  7  OTHER OPTIONS ..... ===>
The following explains the functions on the Precompile panel, and how to enter the fields for preparing to precompile.
1 INPUT DATA SET
Lets you specify the data set name of the source program and SQL statements to precompile.

If you reached this panel through the Db2 Program Preparation panel, this field contains the data set name specified there. You can override it on this panel.

If you reached this panel directly from the DB2I Primary Option Menu, you must enter the data set name of the program you want to precompile. The data set name can include a member name. If you do not enclose the data set name with apostrophes, a standard TSO prefix (user ID) qualifies the data set name.

2 INCLUDE LIBRARY
Lets you enter the name of a library containing members that the precompiler should include. These members can contain output from DCLGEN. If you do not enclose the name in apostrophes, a standard TSO prefix (user ID) qualifies the name.

You can request additional INCLUDE libraries by entering DSNH CLIST parameters of the form PnLIB(dsname), where n is 2, 3, or 4) on the OTHER OPTIONS field of this panel or on the OTHER DSNH OPTIONS field of the Program Preparation panel.

3 DSNAME QUALIFIER
Lets you specify a character string that qualifies temporary data set names during precompile. Use any character string from 1 to 8 characters in length that conforms to normal TSO naming conventions.

If you reached this panel through the Db2 Program Preparation panel, this field contains the data set name qualifier specified there. You can override it on this panel.

If you reached this panel from the DB2I Primary Option Menu, you can either specify a DSNAME QUALIFIER or let the field take its default value, TEMP.

IMS and TSO: For IMS and TSO programs, Db2 stores the precompiled source statements (to pass to the compiler or assemble step) in a data set named tsoprefix.qualifier.suffix. A data set named tsoprefix.qualifier.PCLIST contains the precompiler print listing.

For programs prepared in the background or that use the PREPARATION ENVIRONMENT option EDITJCL (on the Db2 Program Preparation panel), a data set named tsoprefix.qualifier.CNTL contains the program preparation JCL.

In these examples, tsoprefix represents the prefix TSO assigns, often the same as the authorization ID. qualifier represents the value entered in the DSNAME QUALIFIER field. suffix represents the output name, which is one of the following: COBOL, FORTRAN, C, PLI, ASM, DECK, CICSIN, OBJ, or DATA. In the Precompile Panel that is shown above, the data set tsoprefix.TEMP.COBOL contains the precompiled source statements, and tsoprefix.TEMP.PCLIST contains the precompiler print listing. If data sets with these names already exist, then Db2 deletes them.

CICS®: For CICS programs, the data set tsoprefix.qualifier.suffix receives the precompiled source statements in preparation for CICS command translation.

If you do not plan to do CICS command translation, the source statements in tsoprefix.qualifier.suffix, are ready to compile. The data set tsoprefix.qualifier.PCLIST contains the precompiler print listing.

When the precompiler completes its work, control passes to the CICS command translator. Because there is no panel for the translator, translation takes place automatically. The data set tsoprefix.qualifier.CXLIST contains the output from the command translator.

4 DBRM DATA SET
Lets you name the DBRM library data set for the precompiler output. The data set can also include a member name.

When you reach this panel, the field is blank. When you press ENTER, however, the value contained in the DSNAME QUALIFIER field of the panel, concatenated with DBRM, specifies the DBRM data set: qualifier.DBRM.

You can enter another data set name in this field only if you allocate and catalog the data set before doing so. This is true even if the data set name that you enter corresponds to what is otherwise the default value of this field.

The precompiler sends modified source code to the data set qualifier.host, where host is the language specified in the APPLICATION LANGUAGE field of DB2I Defaults panel 1.

5 WHERE TO PRECOMPILE
Lets you indicate whether to precompile in the foreground or background. You can also specify EDITJCL, in which case you are able to edit and then submit the job.

If you reached this panel from the Db2 Program Preparation panel, the field contains the preparation environment specified there. You can override that value if you want.

If you reached this panel directly from the DB2I Primary Option Menu, you can either specify a processing environment or allow this field to take its default value. Use:
  • FOREGROUND to immediately precompile the program with the values you specify in these panels.
  • BACKGROUND to create and immediately submit to run a file containing a DSNH CLIST using the JOB control statement from either DB2I Defaults Panel 2 or your site's SUBMIT exit. The file is saved.
  • EDITJCL to create and open a file containing a DSNH CLIST in edit mode. You can then submit the CLIST or save it.
6 VERSION
Lets you specify the version of the program and its DBRM. If the version contains the maximum number of characters permitted (64), you must enter each character with no intervening blanks from one line to the next. This field is optional.
7 OTHER OPTIONS
Lets you enter any option that the DSNH CLIST accepts, which gives you greater control over your program. The DSNH options you specify in this field override options specified on other panels. The option list can continue to the next line, but the total length of the list can be no more than 70 bytes.