Using Utility Directives

The COBOL conversion utility accepts various directives in the first six columns of COBOL code. Use these directives to override the utility’s normal mode of processing for a single source code line or for a block of lines.

Directive Description Purpose

NOCBGN

No conversion: begin

Starting with this line, do not perform expansions.

NOCEND

No conversion: end

End the NOCBGN directive following this line (the directive line is not expanded).

NOCLN

No conversion: line

Do not perform expansions in this single line.

COCCUR

Convert occurrence

Expand the OCCURS clause instead of the PIC clause in this line.

EXPEOF

Expand end of field

Expand a group item by increasing the length of the last field in the group.

EXPAND

Instruct utility to expand field

Force expansion of fields that would normally not be expanded because they appear to be date, time, or datetime fields.

The following examples use existing PeopleSoft COBOL programs to illustrate possible uses for the utility directives.

NOCBGN, NOCEND, and NOCLN Directives

One of the COBOL programs for PeopleSoft Human Resources has a unique way of setting the PAY-PERIODS group field. The program defines an 88-level definition based on the concatenated value of the five, one-column, character-type fields. If the conversion utility were to convert the program without the special directives, none of the cases that are defined in the 88-level field would ever be true.


               NOCBGN         03  PAY-PERIODS.
                   88  PAY-PERIODS-ALL             VALUE 'YYYYY'.
                   88  PAY-PERIODS-ALL-BIWEEKLY    VALUE 'YYYNN'.
                   88  PAY-PERIODS-ALL-SEMIMONTHLY VALUE 'YYNNN'.
                   88  PAY-PERIODS-NONE            VALUE 'NNNNN'.
                   04  PAY-PERIOD1     PIC X.
                   04  PAY-PERIOD2     PIC X.
                   04  PAY-PERIOD3     PIC X.
                   04  PAY-PERIOD4     PIC X.
                   04  PAY-PERIOD5     PIC X.
               03  FILLER REDEFINES PAY-PERIODS.
                   04  PAY-PERIOD      PIC X       OCCURS 5.
                       88  PAY-PERIOD-YES          VALUE 'Y'.
NOCEND                   88  PAY-PERIOD-NO           VALUE 'N'.
       01  S-DEDPDS.
           02  SQL-STMT                PIC X(18)   VALUE
                                                   'PSPDCFSA_S_DEDPDS'.
           02  BIND-SETUP.
               03  FILLER              PIC X(10)   VALUE ALL 'C'.
               03  FILLER              PIC X(10)   VALUE ALL 'H'.
               03  FILLER              PIC X(10)   VALUE ALL 'D'.
               03  FILLER              PIC X(10)   VALUE ALL 'A'.
NOCBGN                  03  FILLER              PIC X       VALUE ALL 'C'.
               03  FILLER              PIC X       VALUE ALL 'H'.
               03  FILLER              PIC X       VALUE ALL 'C'.
               03  FILLER              PIC X       VALUE ALL 'H'.
NOCEND                  03  FILLER              PIC X       VALUE ALL 'C'.
               03  FILLER              PIC X       VALUE 'Z'.
           02  BIND-DATA.
               03  COMPANY             PIC X(10).
               03  PAYGROUP            PIC X(10).
               03  PAY-END-DT          PIC X(10).
               03  YEAR-END-DT         PIC X(10).
NOCLN                   03  PAY-PERIODS         PIC X(5).
               03  FILLER              PIC X       VALUE 'Z'.

COCCUR Directive

The conversion utility doesn't normally expand the size of the array in this line from one of the PeopleTools COBOL programs. Using the COCCUR directive ensures that the OCCURS clause is expanded:

    02  PARM.
COCCUR      05  PARM-CH             OCCURS 30 TIMES
                          PIC X.

EXPEOF Directive

In the following example, the FIELDNAME group-level field is broken down to check the first 4 characters of the string. In this instance, it makes more sense to adjust the length of the FILLER field. By using the EXPEOF directive, you direct the utility to expand the FILLER field to a length of 50:


               EXPEOF   02  FIELDNAME.
    03  FIELDNAME4          PIC X(4)    VALUE SPACE.
    88  FIELDNAME-TSE               VALUE 'TSE_'.
    03  FILLER              PIC X(14)   VALUE SPACE.