Declaration of numeric host variables in COBOL embedded SQL applications

Numeric host variables that you declare in your embedded COBOL application are treated as if they were declared in a COBOL program. You can use host variables to exchange data between the embedded application and the database manager.

The syntax for numeric host variables is:

Read syntax diagramSkip visual syntax diagram0177variable-namePICTUREPICISpicture-string USAGEISCOMP-31COMPUTATIONAL-3COMP-5COMPUTATIONAL-5 VALUEISvalue .
Notes:
  • 1 An alternative for COMP-3 is PACKED-DECIMAL.

Floating point

Read syntax diagramSkip visual syntax diagram0177variable-nameUSAGEISCOMPUTATIONAL-1COMP-11COMPUTATIONAL-2COMP-22VALUEISvalue.
Notes:
  • 1 REAL (SQLTYPE 480), Length 4
  • 2 DOUBLE (SQLTYPE 480), Length 8
Numeric host variable considerations:
  1. Picture-string must have one of the following forms:
    • S9(m)V9(n)
    • S9(m)V
    • S9(m)
  2. Nines can be expanded (for example., "S999" instead of S9(3)")
  3. m and n must be positive integers.