Designing a Form

As described earlier, the simplest output specification in a forms generation statement assumes the A print code as the default, and takes the form:

@(x,y) : attribute-name

This specification defines a coordinate on the form where the data for a specified attribute will be output. 0,0 is the upper-left corner of the page. The maximum value for x is the width of the page and the maximum value for y is the length of the page.

Consider the generation of a questionnaire form for each customer in the CUSTOMERS file. A one-page questionnaire has already been created on preprinted stock. The forms generation statement should output each customer’s name and address in the blank space provided at the top of each page.

The customer’s full name is to be printed on the third line of each form, the street address on the fourth line, the city and state on the fifth line, and the zip code on the sixth line. This block of information will begin at the fifth column position in each of these four rows; the state and zip code will both begin at the eighteenth column position. This means that there are ten available character spaces for the city. (These values correspond to the column width defined by line 10 of the Attribute Definition item CITY.) The default heading is suppressed, so page numbers, the current time, and the date do not appear on the forms.

The preprinted stock is loaded into the printer tray and this statement is typed:

>SFORMS CUSTOMERS BY LAST-NAME @(5,3):FULL-NAME @(5,4):STREET @(5,5):CITY @(18,5):STATE @(18,6):ZIP HDR-SUPP

The illustration below indicates how the customer’s name and address is output at the top of the form:

The SFORMS command generates the questionnaires in sorted order, by customers’ last names.

More complex types of forms generation that involve MultiValued attributes, multipage forms, background forms, and audit trails are discussed later.

See Also

Generating Forms: an Overview

Using Modifiers in Forms Generation Statements

BREAK-ON, TOTAL, and GRAND-TOTAL Modifiers

Including Item-IDs

Defining Headings and Footings