DB2 7 - What are Host Variables in DB2 ?

What are Host Variables?

HOST variable is temporary variable, which is declared in working –storage section with data type length, equal to DB2 column data type length.
                                                         
Below shows the COBOL vs DB2 declaration.
 

  1. INT                             ->         S9(9)COMP
  2. SMALL INT               ->         S9(4) COMP
  3. DECIMAL(M,N)       ->         S9(M)V9(N) COMPS
  4. CHAR(N)                   ->         X(N)
  5. VARCHAR(N)          ->         S9(4) COMP   X(N)
  6. DATE                                     ->         X(10)   YYYY-MM-DD
  7. TIME                          ->         X(8)     HH:MM:SS
  8. TIMESTAMP             ->         X(26)                                                                                   YYYY-MM- DD:HH:MM:SS:NNNNNN

For more details please go through the below video.



Previous
Next Post »