SQL/MX Programming Manual for C and COBOL (G06.24+, H06.03+)

Host Variables in COBOL Programs
HP NonStop SQL/MX Programming Manual for C and COBOL523627-004
4-3
COBOL Host Variable Data Types
nn column-name.
mm LEN PIC S9(4) COMP.
mm VAL [char-set] PIC X(l)
specifies the data type of a target host variable for a column of the SQL data type:
VARCHAR(l)
The length l corresponds to the maximum length of the column value. The level
numbers are indicated by nn and mm. The level number nn can be any level in the
range 01 to 49, where mm is a greater level than nn. LEN specifies the actual
length of the character item in VAL. VAL is a character data item with length l,
specifying the maximum number of characters that can be stored in VAL.
DATE
specifies the data type of a target host variable for a date-time column that
contains a date in the external form yyyy-mm-dd.
TIME [(n)]
specifies the data type of a target host variable for a date-time column that, without
the optional n precision, contains a time in the external form hh:mm:ss. The n
precision is a positive integer that specifies the number of digits in the fractional
seconds. The default for the precision is 0, and the maximum is 6.
TIMESTAMP [(n)]
specifies the data type of target host variable for a date-time column that, without
the optional n precision, contains a timestamp in the external form:
yyyy-mm-dd hh:mm:ss
The n precision is a positive integer that specifies the number of digits in the
fractional seconds, as shown in bold text:
yyyy-mm-dd hh:mm:ss.msssss
The default for precision is 6, and the maximum is 6.
INTERVAL [period1[(n)] | SECOND [(n[,m])]] [TO period2[(m)]]
where
period 1 must be greater or equal time part than period 2. YEAR to SECOND is
valid. SECOND to YEAR is invalid.
Specifies a column that represents a duration of time as either a year-month or
day-time range or a single-field. period1 can have a leading-precision up to 18
digits (the maximum depends on the number of fields in the interval). The leading-
n leading precision
m fractional precision
period YEAR | MONTH | DAY | HOUR | MINUTE | SECOND