SQL/MP Report Writer Guide
Table Of Contents
- What’s New in This Manual
- About This Manual
- 1 Introduction to the NonStop SQL/MP Report Writer
- 2 Using SQLCI and the Report Writer
- 3 Selecting Data for a Report
- 4 Customizing a Report
- Defining the Layout
- Specifying the Items in a Detail Line
- Naming Select List and Detail Line Items
- Organizing Rows Into Break Groups
- Labeling Information
- Formatting Data Values
- Formatting Dates and Times
- Using TACL to Pass Parameters
- Conditional Printing of Items or Line Entries
- Redefining Special Characters
- Calculating Totals
- Calculating Subtotals
- Printing Double-Byte Characters
- A Comparison of the Report Writer and the Enform Language
- Index

Customizing a Report
HP NonStop SQL/MP Report Writer Guide—527213-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