Host structures in PL/I applications that use SQL

This figure shows the syntax for valid host structure declarations.

Host structures

Read syntax diagramSkip visual syntax diagram
>>-+-+-DECLARE-+--1--variable-name--+----------------------+--,-+-->
   | '-DCL-----'                    '-Scope and/or storage-'    |   
   '-level-1--variable-name--,----------------------------------'   

   .-,----------------------------------------.      
   V                                          |      
>----level-2--+-var-1-----------+--data-types-+--;-------------><
              |    .-,-----.    |                    
              |    V       |    |                    
              '-(----var-2-+--)-'                    

data-types

|--+-+-BINARY-+--+-FIXED-+--+-----------------+--+-----------+-----+--|
   | '-BIN----'  '-FLOAT-'  '-(--precision--)-'  '-UNALIGNED-'     |   
   +-+-DECIMAL-+--+-FIXED--+-------------------------------+--+----+   
   | '-DEC-----'  |        '-(--precision--+----------+--)-'  |    |   
   |              |                        '-,--scale-'       |    |   
   |              '-FLOAT--+-----------------+--+-----------+-'    |   
   |                       '-(--precision--)-'  '-UNALIGNED-'      |   
   +-PICTURE--picture-string---------------------------------------+   
   +-+-CHARACTER-+--+--------------+--+--------------------------+-+   
   | '-CHAR------'  '-(--length--)-'  '-+-VARYING-+--+---------+-' |   
   |                                    '-VAR-----'  '-ALIGNED-'   |   
   +-SQL TYPE IS--+-+-CLOB-+--(--lob-length--+---+--)-+------------+   
   |              | '-BLOB-'                 '-K-'    |            |   
   |              +-+-CLOB_LOCATOR---+----------------+            |   
   |              | +-DBCLOB_LOCATOR-+                |            |   
   |              | '-BLOB_LOCATOR---'                |            |   
   |              '-+-CLOB_FILE---+-------------------'            |   
   |                +-DBCLOB_FILE-+                                |   
   |                '-BLOB_FILE---'                                |   
   +-SQL TYPE IS ROWID---------------------------------------------+   
   '-SQL TYPE IS--+-BINARY---------+--(--length--)-----------------'   
                  +-VARBINARY------+                                   
                  '-BINARY VARYING-'                                   

Notes:
  1. Level-1 indicates that there is an intermediate level structure.
  2. Level-1 must be an integer constant between 1 and 254.
  3. Level-2 must be an integer constant between 2 and 255.
  4. For details on declaring numeric, character, LOB, ROWID, and binary host variables, see the notes under numeric-host variables, character-host variables, LOB host variables, ROWID host variables, and binary host variables.