User guide

Example ENFORM Programs
058058 Tandem Computers Incorporated D–5
The following program shows different ways of formatting dates. Notice that the
JULIAN-DATE clause is used to convert the date to internal format before using the
AS DATE clause. Deldate uses the default heading; the dates converted by the
JULIAN-DATE clause use the HEADING clause. The CENTER clause centers the day
of the week. The WHERE clause restricts the records that contribute to the report.
?DICTIONARY $mkt.dictry
OPEN order;
LIST custnum,
deldate AS M
99/99/99
,
JULIAN-DATE((1900 + dyear),dmonth,dday) AS DATE "DA3"
HEADING "DAY OF WK" CENTER,
JULIAN-DATE((1900 + dyear),dmonth,dday)
AS DATE "MA DAO, Y4"
HEADING "WRITTEN/DATE",
WHERE custnum < 1000;
Report:
Customer WRITTEN
Number DELDATE DAY OF WK DATE
-------- -------- --------- ------------------------------
21 07/20/78 THU JULY TWENTIETH, 1978
123 08/20/78 SUN AUGUST TWENTIETH, 1978
143 10/20/78 FRI OCTOBER TWENTIETH, 1978
324 09/15/78 FRI SEPTEMBER FIFTEENTH, 1978
543 08/10/78 THU AUGUST TENTH, 1978
926 07/01/78 SAT JULY FIRST, 1978
The following program resets the Option Variable @SUBTOTAL-LABEL. The new
value appears in place of the default value asterisk (*).
Three record descriptions are linked together, creating a new logical record
description. The BY clause groups the records on the value of ordernum. Notice that
ordernum and partnum require qualification, because they appear in more than one
record description.
The AS clause uses the mask format to print partnum in two columns. The HEADING
clause overrides the default QUANTITY heading, creating a narrower column width
in the report.
A new report item is created with the arithmetic expression (price * quantity). A
subtotal is printed for the new report item, assuming OVER order.ordernum. Notice
that asterisks are printed for the second subtotal, because the calculated value
2,241,600.83 exceeds the field width in the mask format. The mask format should be
increased at least one more digit.
The WHERE clause restricts the records that contribute to the report.