SQL/MX Report Writer Guide

Customizing a Report
HP NonStop SQL/MX Report Writer Guide527194-002
4-37
Monetary Values
+> GROUP BY JOBCODE;
S> DETAIL JOBCODE AS I4 HEADING 'Job',
+> COL 2 AS '[PF''$''] M<Z,ZZZ,ZZZ.99>'
+> HEADING 'Avg. Sal.';
S> LIST NEXT 5;
Job Avg. Sal.
---- -----------
100 $105,954.59
200 $24,000.00
250 $28,000.06
300 $31,123.05
400 $77,400.00
S>
Figure 4-16 interprets the display format specified for COL 2 in the previous query. The
form of decoration is:
condition location char-string
The entire display format must be enclosed in quotation marks. The decoration must
be enclosed in square brackets.
The previous decoration specification requires that all values be positive. If you expect
negative or zero values, you must expand the decoration:
AS '[MA1''CR'',MPF''$'',ZA1' '] F13.2'
In this clause, three decorations apply to the value:
Figure 4-16. Sample Decoration
AS ' [PF ''$'' ] F11.2'
char-string
to be inserted
location
F for immediately to
left of value
condition
P for postive
display-descriptor
fixed point, width 11,
2 digits to right of
decimal place
VST0416.vsd