SQL/MP Report Writer Guide

Customizing a Report
HP NonStop SQL/MP Report Writer Guide527213-001
4-29
Formatting Data Values
You might decide that the default display produces a format that does not suit your
needs. You can add an AS clause to the print item in the DETAIL command to override
the default format for any data type except DATE, DATETIME, INTERVAL, TIME, and
TIMESTAMP. You can use the AS clause to modify the field width, adjust the scale of a
number, insert special symbols called decorations, and change the justification of a
character value from left to right.
DECIMAL (n,s) In+1 (or Fn+2.s if s > 0)
DECIMAL (n,s) UNSIGNED In (or Fn+1.s if s > 0)
PIC S9(i) [V9(s)] Ii+1 (or Fi+2.s if s > 0)
PIC 9(i) [V9(s)] Ii (or Fi+1.s if s > 0)
PIC SV9(s) Fs+2.s
PIC V9(s) Fs+1.s
FLOAT (where precision is 1 through
22)
E14.7
FLOAT (where precision is 23 through
54)
E24.17
REAL E14.7
DOUBLE PRECISION E24.17
n Length
vw Current VARCHAR_WIDTH value
s Scale of the data type
i Integer
A, I, F For more information see Display Format Specifications
on page 4-30.
E Edit descriptor, explained in the Guardian Programmer's Guide
DATE
DATETIME
TIME
TIMESTAMP
INTERVAL
yyyy-mm-dd
yyyy-mm-dd:hh:mm:ss.msssss
hh:mm:ss
yyyy-mm-dd:hh:mm:ss.msssss
yyyy-mm or dd:hh:mm:ss.msssss
yyyy Years
-mm Months
dd Days
hh Hours
:mm Minutes
ss Seconds
msssss Microseconds
Table 4-1. Default Display Formats (page 2 of 2)
SQL Data Type Default Display Format