SQL/MX Report Writer Guide

Customizing a Report
HP NonStop SQL/MX Report Writer Guide527194-002
4-36
Monetary Values
code within each department and to produce subtotals and totals, the mask must be
modified to accommodate larger numbers in the detail line and large numbers in the
subtotal and total lines.
>> SELECT DEPTNUM, JOBCODE, SUM(SALARY)
+> FROM EMPLOYEE
+> ORDER BY DEPTNUM
+> GROUP BY DEPTNUM, JOBCODE;
S> DETAIL DEPTNUM AS I6 HEADING 'Dept.',
+> JOBCODE AS I4 HEADING 'Job',
+> COL 3 AS M<$ZZZ,ZZZ,ZZZ.99>
+> HEADING 'Sum of Salaries';
S> BREAK ON DEPTNUM ;
S> SUBTOTAL COL 3 OVER DEPTNUM ;
S> TOTAL COL 3;
S> LIST ALL ;
Figure 4-15 shows the report.
Using Decorations in Display Formats
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 EMPLOYEE
Figure 4-15. Monetary Total and Subtotals
.
.
.
.
.
.
.
.
.
1000 100 $ 137,000.10
500
900
$ 104,000.75
$ 19,000.00
*
$ 260,000.85
Dept.
Job
Sum of Salaries
9000 100 $ 175,500.00
900
$ 37,000.00
*
$ 212,500.00
$ 2,780,725.57
--- 34 row(s) selected.
> >
VST0415.vsd