RPG/400 Help


Control Specifications

The control specification statement, identified by an H in column 6, provides information about generating and running programs. Only one control specification is allowed per program. In the OS/400 system, you can create a data area named RPGHSPEC to contain the information to be used for all RPG/400 programs that do not contain a control specification.

The data area must be a character string 80 positions long. Use the CL command CRTDTAARA (Create Data Area) to create the data area. Specify as the initial value of the data area the entries for the control specification that are to be used. For example, if the DEBUG operation is to be used for all RPG/400 programs, place an initial value of 1 in position 15 of the data area. (See the Programming: Control Language Reference for a description of the Create Data Area command.) The library in which the data area is placed must be in the library list when the program is compiled.

If you are using Program Verifier on a program which uses the data area RPGHSPEC you must create a file called RPGHSPEC.RPG and place it in the CODE base directory. The installation default for that directory is D:|CODE. The file should contain the same specifications as are in the RPGHSPEC data area you would be using on the host.

The RPG/400 language uses the control specification that is present in the program. In the OS/400 system, if a control specification is not present, the RPG/400 compiler checks for the data area RPGHSPEC in *LIBL. If the data area is not found, the RPG/400 compiler checks for the data area DFTHSPEC in QRPG. If it is not found, a default specification with blanks in positions 7 through 74 is used, (no data area is created). Since QRPG is the product library for the CRTRPGPGM command, if a data area called RPGHSPEC exists in QRPG it will always be found. Use the data area DFTHSPEC in QRPG to create a common control specification for your installation, and use RPGHSPEC in your library to override this specification.

If a control specification is not present, Program Verifier will search for the file RPGHSPEC.RPG in the CODE base directory. If that file is not found, a default blank H specification will be used.

See the description of the individual entries for the meaning of blank entries and for an explanation of the program name. If the default blank specification is used, asterisks are printed on the compiler listing under the Page/Line heading. Compiler-generated symbols are placed in the symbol table.


[ Top of Page | Previous Page | Next Page | Table of Contents ]