SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
A-61
AS Clause
PIC 9 data type is numeric and should not use the A[w] descriptor. Table A-3 describes
descriptors that you can use with PIC 9.
A print position is one byte, so a double-byte character (which occupies two print
positions) requires a descriptor width of at least twice its number of characters. For
example, a double-byte column with ten characters requires an A20 display descriptor.
Table A-2. Display Descriptors for Character Items
Form and Usage Example Value Printed
A[w]
Character field, w print positions wide.
Default for w is width of item. If too small,
left justify and blank fill. If too large,
truncate.
A
A4
A3
“[LJ] A3”
“[RJ] A3”
WORD
WORD
WORD
WORD
WORD
|WORD|
|WORD|
|WOR|
|WOR|
|ORD|
Cn[.w]
Multiline character field, n print positions
wide with w print positions per line. If n is 0,
use width of item; if n is more than 255,
you must specify w.
C0.8 Customer has
a low credit
rating.
(VARCHAR
string)
|Customer|
| has a l|
|ow credi|
|t rating|
|. |
To break a value at blanks, use the F
modifier with a Cn descriptor.
“[F] C40.8” A reliable
vendor - fast
delivery
|A |
|reliable|
| vendor |
| — fast |
|delivery|
w is an unsigned integer in the range 1-255
n is an unsigned integer in the range 1-4071
| | indicates the boundaries of the output field
LJ and RJ are modifiers (covered later in this entry) that specify left and right justification
Table A-3. Display Descriptors for Numeric Items (page 1 of 2)
Form and Usage Example Value Printed
Fw.d [.m]
Fixed point field, w print positions
wide with d significant digits to the
right of the decimal and m to the left.
Right justify, blank fill, leading zeros if
needed.
F8.4
F8.4
F8.4.2
“[FL'*']F8.2”
123.4567
0.000123 -
4.56789
123.4567
|123.4567|
| 0.0001|
|-04.5679|
|**123.46|
Iw [.m]
d, w, and n are unsigned integers in the range 1-255.
| | indicates the boundaries of the output field.