COBOL variable names

If a program uses more than one tableBASE table, the use of a different command area for each table is strongly recommended. This will allow the program to provide greater efficiency.

A typical COBOL structure describing a row area for the table HOS2RATE follows:

       20 W-HOS2RATE-CUSTOMER-CLASS-CODE         PIC X(2).
       20 W-HOS2RATE-SPECIAL-DISC-CODE           PIC X(4).
    10 W-HOS2RATE-RATE                           PIC 999V99.

All COBOL variable names in parameters that relate to a specific table should be prefixed by the table name, as shown in the example above. In addition, it is recommended that prefixes include codes which denote the type of storage used for the variable (for example, W for working storage, L for the linkage section, T for the transaction work area, etc.).

Such variable names appear in the COBOL examples of parameter code described in Chapter 4 and in the sample code below. Identical code is provided in the distributed tableBASE Education dataset, in the member your.prefix.TBASE.SRC(TBPARMS). Variable names that relate to a single table are prefixed by “xxxx” to indicate a coding template that requires modification. The generic “xxxx” is intended to be replaced by a specific table name when used in an application.