ROWID host variables in COBOL applications that use SQL

COBOL does not have a variable that corresponds to the SQL data type ROWID. To create host variables that can be used with this data type, use the SQL TYPE IS clause. The SQL precompiler replaces this declaration with a COBOL language structure in the output source member.

ROWID

Read syntax diagramSkip visual syntax diagram
>>-01--variable-name--SQL TYPE IS ROWID-- . -------------------><

Note: SQL TYPE IS ROWID can be in mixed case.

ROWID Example

The following declaration:

01 MY-ROWID SQL TYPE IS ROWID.

Results in the generation of the following structure:

01 MY-ROWID.
   49 MY-ROWID-LENGTH PIC 9(2) BINARY.
   49 MY-ROWID-DATA PIC X(40).