LOB file reference variables in ILE RPG applications that use SQL

The following are examples of LOB file reference variables in ILE RPG.

CLOB file reference example

The following declaration:

D MY_FILE         S          SQLTYPE(CLOB_FILE)

results in the generation of the following structure:

D MY_FILE          DS
D MY_FILE_NL                      10U
D MY_FILE_DL                      10U
D MY_FILE_FO                      10U
D MY_FILE_NAME                   255A

BLOB and DBCLOB locators have similar syntax.

Notes:
  1. LOB file reference variables are allowed to be declared in host structures.
  2. SQLTYPE, BLOB_FILE, CLOB_FILE, DBCLOB_FILE can be in mixed case.
  3. SQLTYPE must be between positions 44 to 80.
  4. When a LOB file reference is declared as a standalone host variable, position 24 must contain the character 'S' and position 25 must be blank.
  5. The standalone field indicator 'S' in position 24 should be omitted when a LOB file reference variable is declared in a host structure.
  6. LOB file reference variables cannot be initialized.

The pre-compiler will generate declarations for the following file option constants. You can use these constants to set the xxx_FO variable when you use file reference host variables.

Related information
LOB file reference variables