SQL/MP Report Writer Guide

Customizing a Report
HP NonStop SQL/MP Report Writer Guide527213-001
4-44
Using TACL to Pass Parameters
You can use the JULIANTIMESTAMP function with a TIMESTAMP column named
NEXT_MEETING:
JULIANTIMESTAMP (NEXT_MEETING) AS DATE "MA DB2, Y4"
To get the day of the week printed as a word such as Sunday, you can use the
following print item:
JULIANTIMESTAMP (CURRENT) AS DATE "DA"
For a TIMESTAMP column named XX, you can use the following print item:
JULIANTIMESTAMP (XX) AS DATE "DA"
If your database contains Julian timestamps in a column, but you want to print them in
European format, you can use the CONVERTTIMESTAMP function. For example,
assume DATE_TIME is a Julian timestamp:
DATEFORMAT (CONVERTTIMESTAMP (DATE_TIME), EUROPEAN)
Formats for Dates Stored as Binary Values
If the date is stored as a binary value but not as a timestamp, you can use a mask to
enhance the display. For example, the DELIV_DATE column is defined as data type
NUMERIC(6) and contains values such as 870618 representing YYMMDD. If you want
to print the date with the units separated by slashes, you can use the following mask in
the print item:
DELIV_DATE AS M<03/03/03>
The printed result is 03/07/18.
Using TACL to Pass Parameters
If you want to pass a parameter value to a report formatting command, you can write a
TACL macro and pass the parameter to the macro when you run it. The parameter is
inserted into the report formatting command before it is sent to SQLCI. Figure 4-17
on
page 4-45 illustrates this technique.