SQL/MP Report Writer Guide

Customizing a Report
HP NonStop SQL/MP Report Writer Guide527213-001
4-34
Formatting Data Values
If you want the dollar sign adjacent to the value, you can modify the original query by
adding a PF modifier and by revising the mask descriptor:
>> SELECT JOBCODE, AVG(SALARY)
+> FROM PERSNL.EMPLOYEE
+> 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.
Figure 4-16. Example of a 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