Exceptions to Data Division Conversion Rules

There are a few exceptions to the data division rules to make the program compile and work correctly. For the utility to recognize these exceptional cases, strict adherence to the PeopleSoft COBOL coding standards is required. The utility looks for certain code-style patterns to make these decisions.

This section discusses the following areas where there are exceptions to data division rules:

  • SQL buffer setup area.

  • SQL buffer data area.

  • File status field.

  • FD entry in file section.

SQL Buffer Setup Area

For the interface to PTPSQLRT a COBOL program passes a SELECT list (SELECT-DATA) and a descriptor area (SELECT-SETUP). The program also passes similar data and setup areas for bind variables. The descriptors that are passed are always character-type data with embedded values that signal the actual data type and length of the data fields.

Because PTPSQLRT is designed to process the descriptors as alphanumeric character arrays (instead of national character arrays), the conversion utility does not convert the data type of the descriptor fields. However, it doubles the size of the descriptor field that is representing character-type data. Each data field in the descriptor area has associated field in SELECT-DATA or BIND-DATA field, and the byte size of the corresponding field in –DATA area doubles because of the change from PIC X to PIC N. Because of this implicit field size expansion, the corresponding field in –SETUP area should be doubled in size. Example: The following BIND-SETUP area is converted to match with BIND-DATA in byte size. Character fields are converted to double of the original size, to match with the size of the field in BIND-DATA area. Numeric and delimiter (‘Z’) items are not converted.

05  BIND-SETUP.
10  FILLER              PIC X(22)   VALUE ALL 'C'.
10  FILLER              PIC X(8)    VALUE ALL 'H'.
10  FILLER              PIC X(02)   VALUE ALL 'S'.
10  FILLER              PIC X(01)   VALUE 'Z'.

05  BIND-DATA.
10  EMPLID              PIC N(11).
10  ACAD-CAREER         PIC N(04).
10  STDNT-CAR-NBR-REAL  PIC S9(04)              COMP.
10  FILLER              PIC N(01)   VALUE N'Z'.

SQL Buffer Data Area

In the SQL buffer data area the conversion utility does not convert character data that is redefining numeric data. By convention in PeopleSoft application COBOL programs, this type of redefinition is used only for the purpose of using one data area for different number of variables. This type of character field can be in PIC X type that the conversion utility will not change the data type to PIC N.Example: PAGE-NO-FILLER, which is redefining binary field and in SQL buffer data area, is not converted to PIC N.02 BIND-DATA.

03  COMPANY             PIC N(10).
03  PAYGROUP            PIC N(10).
03  PAY-END-DT          PIC N(10).
03  OFF-CYCLE           PIC N.
03  PAGE-NO             PIC 9999                COMP.
03  PAGE-NO-FILLER REDEFINES PAGE-NO
                        PIC XX.
03  FILLER              PIC N       VALUE N'Z'.

File Status Field

The conversion utility does not convert a file status field (that includes “FILE-STAT” in name), because file status field (specified in FILE STATUS clause of FILE-CONTROL paragraph) must have the form of two-character alphanumeric or numeric item. It cannot be two-character national item.

Example: FILE-STAT-CTLFILE is not converted because it is file status field.

INPUT-OUTPUT SECTION.

FILE-CONTROL.

     SELECT CTLFILE  ASSIGN TO UT-S-CTLFILE
     FILE STATUS IS FILE-STAT-CTLFILE.
DATA DIVISION.
WORKING-STORAGE SECTION.

01  PROGRAM-IDENTITY       PIC N(8)    VALUE N'PTPCTL'.
01  FILE-STAT-CTLFILE      PIC XX      VALUE '00'.
01  MORE-INPUT             PIC N(1)    VALUE SPACES.

FD Entry in File Section

A line containing the RECORD CONTAINS clause in the FD data field will be commented out. If this line is not commented out, the program may cause an error at compile time because the record field is normally converted to a PIC N field and the record size will not match with the size specified in RECORD CONTAINS clause.

Note:

This conversion eliminates compile errors. To read and write files either in Unicode or in EBCDIC, you may need to further modify the program manually to guarantee the correct file operation.

Example: Line containing “RECORD CONTAINS” clause is commented out in FD field declaration.

FD  TESTFILE
*   RECORD CONTAINS 80 CHARACTERS
     RECORDING MODE IS F
     LABEL RECORDS OMITTED.
01   TESTFILE-RECORD              PIC N(80).