Appendix C. CRTBNDCBL COMMAND AND PROCESS STATEMENT

CRTBNDCBL COMMAND

The CRTBNDCBL (Create Bound COBOL) command is used to compile a single ILE COBOL/400 program (source member) into a program object (Type *PGM).

OPTION 14 ON WORK WITH MEMBERS USING PDM SCREEN

The Work with Members Using PDM screen, shown in Figure C.1, illustrates how a screen option (option 14) can be used to compile an ILE COBOL/400 program. The number 14 is entered on the option line beside the source ILE COBOL/400 program (CPCH02A) that is to be compiled. Notice that option 14 is not listed in the option list at the top of the screen. On many screens, like the Work with Members Using PDM screen, there are more options than can be displayed on the screen at one time. The F23 key (More options) can be used to display the other options that are available.

Using option 14 to compile an ILE COBOL/400 program.

Figure C.1. Using option 14 to compile an ILE COBOL/400 program.

When option 14 is used to compile an ILE COBOL/400 program from the Work with Members Using PDM screen, OS/400 will automatically submit, to the batch queue, the CRTBNDCBL command.

PROMPTING THE CRTCBNCBL COMMAND

Another method used to compile an ILE COBOL/400 program is to enter CRTCBNCBL on the command line and press F4 (Prompt) to display the prompt screen. Once the parameters are entered into the prompt screen, the command is submitted.

An example of the prompt screen for the CRTCBNCBL command is illustrated in Figure C.2. In this example, parameters are submitted along with the command to tell OS/400 how to execute the command. In Figure C.2, program CPCH02A, located in source physical file QCBLLESRC, is being compiled.

Using the CRTCBNCBL prompt screen to submit the CRTCBNCBL command.

Figure C.2. Using the CRTCBNCBL prompt screen to submit the CRTCBNCBL command.

SUBMITTING THE CRTCBNCBL COMMAND FROM THE COMMAND LINE

The CRTBNDCBL command can also be entered directly on the command line as shown in Figure C.3.

Submitting the CRTBNDCBL command from the command line.

Figure C.3. Submitting the CRTBNDCBL command from the command line.

The name of the program object that is to be created is taken from the PROGRAM–ID paragraph in the COBOL/400 source program. Since a library is not specified for the compiled object, the current library is used. If a current library is not assigned, QGPL is used.

PARAMETERS OF THE CRTCBNCBL COMMAND

The CRTCBNCBL command contains many parameters that can be submitted along with the command. If you cannot remember all of the parameters, press F4 (Prompt) after entering 14 beside the member you wish to compile or after

entering CRTCBNCBL on the command file. When F4 (Prompt) is pressed the CRTCBNCBL prompt (fill-in-the-blanks) screen appears and you can enter the parameters required for your particular compile. Most parameters contain default values that are used. A description of a few parameters for the CRTCBNCBL command is described below. If you wish to learn more about each of the other parameters, enter the CRTCBNCBL command, press F4 (Prompt), and place the cursor on any of the fields (parameters) and press F1 (Help). The help screens provide information about the parameters.

The PGM parameter specifies the program name and library name for the ILE COBOL/400 program that is being compiled. The name for the program object is taken from the PROGRAM–ID paragraph in the ILE COBOL/400 source program. If you do not specify a library name, the current library is used. If you have not assigned a library as the current library, QGPL is used.

The SRCFILE parameter specifies the name of the source file that contains the ILE COBOL/400 source to be compiled. If a source file is not specified, QCBLLESRC is used by default. If you do not specify a library name, the system searches the library list to find the library where the source file is located.

The OPTION parameter is used to submit a list of options along with the compile. Four of these options include:

  • The *OPTIONS option provides a list of all options that are in effect for the compilation.

  • The *APOST option specifies that the delimiter apostrophe (') is used for nonnumeric literals and Boolean literals. This also specifies that the value of the figurative constant QUOTE has the EBCDIC value of an apostrophe.

  • The *XREF option produces a cross-reference listing for the source program.

  • The *MAP option lists the Data Division map.

See Figure C.4 for an illustration of a compiled COBOL/400 program that contains the options discussed in this section.

PROCESS STATEMENT

The PROCESS statement is an optional part of the COBOL source program. The PROCESS statement is used to specify options normally specify at compilation time. Options specified in the PROCESS statement override the corresponding options specified in the CRTCBNCBL CL command.

The format of the PROCESS statement is as follows:

Instruction Format

PROCESS option-1
The following rules apply:
  • The statement must be placed before the first source statement in the COBOL program immediately preceding the IDENTIFICATION DIVISION header.

  • The statement begins with the word PROCESS. Options can appear on more than one line; however, only the first line can contain the word PROCESS.

  • The word PROCESS and all options must appear within positions 8 through 72. Position 7 must be left blank. The remaining positions can be used as in COBOL source statements: positions 1 through 6 for sequence numbers, positions 73 through 80 for identification purposes.

  • The options must be separated by blanks and/or commas.

  • Options can appear in any order. If conflicting options are specified, for example, XREF and NOXREF, the last option encountered takes precedence.

The FS9MTO0M parameter is used and discussed in Chapter 17. During subfile processing, the system will return a 9M file status code if the program tries to add more records to the subfile then have been defined in the subfile DDS. However, when this happens, the system should extend the size of the subfile rather than terminate the program. The purpose of the FS9MTO0M parameter is to change the file status from 9M to 0M. This prevents the program from terminating, which allows the system to dynamically increase the size of the subfile and continue processing. A file status beginning with 9 is a severe error that causes the program to terminate. A 0M file status, however, is a warning error. In our program examples, we specify the PROCESS FS9MTO0M statement as the first statement in the program. This statement changes the File Status 9M return code to 0M (File Status 9M TO 0M). Changing the file status prevents a program interrupt and also allows the subfile to grow dynamically. When the program tries to add more records to the subfile then are specified in the SFLSIZ keyword, the subfile will automatically be extended to make room for any additional records.

Not every CRTCBNCBL parameter has a corresponding option in the PROCESS statement. Refer to the COBOL/400 Programmer's Guide for more information about the allowable PROCESS statement options and the equivalent CRTCBNCBL command parameters and options.

The PROCESS statement, if specified, is printed first. In the compiled version of program CPCH02A, Figure C.4, all options specified in the CRTCBNCBL command, as modified by the PROCESS statement are listed first. Compiler options are listed at the beginning of all compiler output when the OPTIONS parameter is specified.

Compiled COBOL/400 program with PROCESS options

Figure C.4. Compiled COBOL/400 program with PROCESS options

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset