User guide

Formatting a Report
Developing an ENFORM Query
058058 Tandem Computers Incorporated 3–55
Temporarily Changing the Default Display Format of an Element
Use the AS clause to temporarily override the default display format (described earlier
in this section) used for printing the value of an element. Within the AS clause,
indicate the new display format by specifying edit descriptors, modifiers, and
decorations.
Edit descriptors specify the display format as alphanumeric, fixed, or integer. A
special edit descriptor describes the display format according to a template. Edit
descriptors also specify the display format width. The following query indicates the
display format for price is fixed with 5 digits to the left of the decimal place and 2 digits
to the right of the decimal place:
OPEN parts;
LIST partnum,
partname,
price AS F7.2,
WHERE partnum LT 1000;
Report:
Part
Number PARTNAME PRICE
------ ------------------ --------
212 SYSTEM 192KB CORE 97000.00
244 SYSTEM 192KB SEMI 87000.00
Edit modifiers indicate field blanking, character insertion, fill character specification,
scale factor specification, left and right justification, overflow character specification,
and symbol substitution. The following query indicates partname is to be printed on
the report right-justified (left-justified is the default for alphanumeric data) in a
column 20 characters wide:
OPEN parts;
LIST partnum,
partname AS "[RJ]A2",
price,
WHERE partnum LT 1000;
Report:
Part
Number PARTNAME PRICE
------ -------------------- ---------
212 SYSTEM 192KB CORE 97000.00
244 SYSTEM 192KB SEMI 87000.00