In the table below a lowercase n is a number. A lowercase v is a nominal value.
|
SQL Data Type |
Operand Formats |
Notes |
|---|---|---|
|
CHARACTER |
C |
|
|
NUMERIC |
Z |
The nominal value is used to determine scale. If no nominal value is given, then the scale is set to zero. For implicit length, the nominal value is used to determine precision and scale. Where both the length modifier and the nominal value are coded, the explicit length from the length modifier is used. |
|
DECIMAL |
PLn |
The nominal value is used to determine scale. If no nominal value is given, then the scale is set to zero. For implicit length, the nominal value is used to determine precision and scale. Where both the length modifier and the nominal value are coded, the explicit length from the length modifier is used. |
|
SMALLINT |
H |
When the length modifier is coded, it must be two. Any nominal value is ignored. |
|
INTEGER |
F |
When the length modifier is coded, it must be four. Any nominal value is ignored. |
|
FLOAT |
D |
When the length modifier is coded, it must be eight. Any nominal value is ignored. |
|
DATE |
CLn |
The length must be 10 or more. |
|
TIME |
CLn |
The length must be eight or more. |
|
TIMESTAMP |
CLn |
The length must be 26 or more. |
|
VARCHAR |
H,CLn |
The operation must have two and only two operands with the halfword followed by the character. Either, both or neither type may have a nominal value. Likewise a length modifier. |
|
LONG VARCHAR |
H,CLn |
The operation must have two and only two operands with the halfword followed by the character. Either, both or neither type may have a nominal value. Likewise a length modifier. |
|
GRAPHIC |
DC or DS |
|
|
VARGRAPHIC |
DC or DS |
|
|
LONG VARGRAPHIC |
DC or DS |
|
Note: The CA Datacom/DB Preprocessor for Assembler recognizes GRAPHIC host variables and allows mixed data in literals. The Shift-Out and Shift-In characters specified in the CXXMAINT option of the CA Datacom/DB Utility (DBUTLTY) are used by the Preprocessor.
Example 1
*------------------------------ * Valid host variables *------------------------------ LASTNAME DS CL30 . CHAR(30) POBOX DS ZL9 . NUMERIC(9) with scale 0 ZIPCODE DS PL5 . DEC(9,0) ZIPSPLIT DS P'+99999.9999'. DEC(9,4) CUR$PAY DC H'0' . SMALLINT CUM$PAID DC F'0' . INTEGER INTRATE DS D . FLOAT(n) LACTDATE DC C' ' . date area LACTTIME DS CL8 . time area LTXNSTMP DC CL26' ' . timestamp are STREET DS H'0',CL40 . VARCHAR(40) CITY DS H,CL30 . VARCHAR(30) STATE DS H'0',CL20' ' . VARCHAR(20) *------------------------------ * Indicator variables *------------------------------ NAMEFND DC H'0' ZIPAVAL DS H
|
Copyright © 2014 CA.
All rights reserved.
|
|