Numeric-host variables in PL/I applications that use SQL

This figure shows the syntax for valid scalar numeric-host variable declarations.

Numeric

Read syntax diagramSkip visual syntax diagram
>>-+-DECLARE-+--+-variable-name-----------+--------------------->
   '-DCL-----'  |    .-,-------------.    |   
                |    V               |    |   
                '-(----variable-name-+--)-'   

>--+-+-BINARY-+--+-FIXED--+-----------------+-+--------------+-->
   | '-BIN----'  |        '-(--precision--)-' |              |   
   |             '-FLOAT--+-----------------+-'              |   
   |                      '-(--precision--)-'                |   
   +-+-DECIMAL-+--+-FIXED--+-----------------------------+-+-+   
   | '-DEC-----'  |        '-(--precision--+--------+--)-' | |   
   |              |                        '-,scale-'      | |   
   |              '-FLOAT--+-----------------+-------------' |   
   |                       '-(--precision--)-'               |   
   '-PICTURE--picture-string---------------------------------'   

>--+---------------------------------------+--;----------------><
   '-Alignment and/or Scope and/or Storage-'      

Notes:
  1. (BINARY, BIN, DECIMAL, or DEC) and (FIXED or FLOAT) and (precision, scale) can be specified in any order.
  2. A picture-string in the form '9...9V9...R' indicates a numeric host variable. The R is required. The optional V indicates the implied decimal point.
  3. A picture-string in the form 'S9...9V9...9' indicates a sign leading separate host variable. The S is required. The optional V indicates the implied decimal point.