SFORMS Command

The SFORMS command prints file items in sorted order on such forms as invoices, checks, and order forms. Using SFORMS allows you to explicitly position data either on the terminal or on a printer page according to x- (column) and y- (row) coordinates. SFORMS prints one item per form.

Format

SFORMS [DICT] filename [item-list] [selection] [sort-keys] output [print] [modifiers] [(options)]

Parameter(s)

A valid Windows path on the host operating system. The path may be any Windows directory or file name path without requiring surrounding quotation marks. For example:

SET-TAPEFILE C:\ORDER ENTRY\ LOS ANGELES

 

DICT

Specifies the file dictionary.

filename

Name of the file.

item-list

List of individual item-IDs. Enclose each item-ID in single quotes.

selection

Specifies one or more conditions that an item must meet to be listed on a form. For a complete description of selection expression syntax, see the LIST Command.

sort-keys

Specifies which attributes to sort and whether to sort them in descending or ascending order. See the SORT command for a description of the four sort modifiers.

output

List of attributes to be included in the report. output can also be a phrase that contains any INFO/ACCESS parameters except a command or a file name.

print

Specifies which values from MultiValued attributes are to be included in the report. Use relational operators and values immediately following the name of the MultiValued attribute. Enclose values in double quotes or backslashes.

modifiers

Include one or more keywords that modify the appearance of the form. These parameters affect headings, footings, and more. For complete information about modifiers, see the section, Connectives, Modifiers, and Options in the INFO/ACCESS User Reference Guide.

Following modifiers behave somewhat differently when used with forms generation commands: BREAK-ON, FOOTING, HDR-SUPP, HEADING, and ID-SUPP. These modifiers are described below in the section, Forms Generation Modifiers, in the INFO/ACCESS User Reference Guide.

options

Include one or more single-character codes that specify the report format and direct or modify output. They must be enclosed in parentheses, can be entered in any order, and need not be separated by spaces or any delimiters such as commas. For complete information about using these parenthetical options, see the section Connectives, Modifiers, and Options, in the INFO/ACCESS User Reference Guide.

In addition to the standard INFO-ACCESS options, the following three options are also available. These nonstandard options are fully described in the Forms Generation Options section of the FORMS command.

A

Allows you to check printer alignment.

B

Prints a prestored background form along with the data specified in the FORMS statement.

Z

On multipage forms, resets footing page number to one.

Description

The SFORMS command applies the format specified in the command line to the output specifications. SFORMS prints one item per form; a form can be either single-page or multipage. Data can be printed anywhere on a page, and can be printed on just one page or on every page of a form. In addition to specifying how the data is to be printed on a form, the SFORMS command can be used to specify the layout of the form itself.

Print codes can also define vertical windows in which the data for MultiValued attributes can be output. If all of the data for a MultiValued attribute does not fit in a window, the remaining data is printed on the next page. A form can contain up to six separate windows.

The REPT and SREPT commands can be used to print more than one item on a page.

Print Codes

Each attribute-name included on a form must be associated with a print code as follows:

@code (x,y [,z]) : attribute-name [1,n]

To define a character string that prints in a specified location on the form, use the following syntax:

@code (x,y [,z]) : "string" [1,n]

 

code

Print code associated with the attribute. The available print codes are shown in the table below.

x

Horizontal position (column) on the page where the data begins. The leftmost position is column 0.

y

Vertical position (row) on the page where the data begins. The top row is row 0, which is reserved for the heading.

z

Extra data required by certain print codes.

attribute-name

Name of the attribute whose data is printed at the specified position.

string

A character string that is printed at the specified position.

n

Prints only the first n characters of the data for this attribute.

The following list summarizes the available print codes.

Print Code

Description

@ [A] (x,y)

Prints the data for an attribute on every page of a multipage form. The A is optional.

@C(x,y)

Creates an audit trail for a series of forms. The @C code can also be used to serialize the forms. To suppress serialization numbers on the form (but not in the audit file), specify (–1) in place of the x and y coordinates. (You must use either the x-y coordinates or –1 with the @C code.)

@D(x,y,z)

Prints data for MultiValued attributes in double-depth windows. This makes it possible to define two lines of output at a time. z specifies the bottom-most row of a window whose top-most row is defined by y.

@F(x,y)

Prints the data for an attribute on only the first page of a multipage form.

@L(x,y)

Prints the data for an attribute on only the last page of a multipage form.

@M(x,y,"text")

Prints the specified text on all but the last page of a multipage form. The data for the attribute prints on the last page of the form. On a single-page form, the data for the attribute is printed.

@W(x,y,z)

Prints data for MultiValued attributes in windows. x specifies the columns where attribute values are to start being printed. z specifies the bottommost row of a window whose topmost row is defined by y.

For complete information about using print codes, see the Forms Generation section in the INFO/ACCESS User Reference Guide.

Sorting Items on a Form

The following example sorts items in the ORDERS file by LAST-NAME, creates an invoice form, and lists each item on the screen. The orders eventually are sent to the printer to be printed on preprinted paper that contains constant text:

>SFORMS ORDERS BY LAST-NAME

@(1,3):FIRST-NAME @(8,3):LAST-NAME

@(1,4):STREET @(1,5):CITY @(15,5):STATE

@(1,8):DATE @W(1,11,15):TITLE @W(40,11,15):NUM

@W(45,11,15):PRICE @(45,17):AMOUNT  @(45,18):TAX @(45,19):TOTAL.AMT  FOOTING"***THANK YOU FOR YOUR ORDER - HAVE A NICE SUMMER!***" HDR-SUPP

 

MARY ASH

 

 

912A E. OAK STREET

 

 

INDIANAPOLIS  IN

 

 

 

 

 

27 MAR 1988

 

 

 

 

 

DATABASE MANAGEMENT SYSTEMS

3

$9.00

OPERATING SYSTEM CONCEPTS

5

$20.00

WRITING COMMERCIAL APPLICATIONS

1

$20.00

WORD PROCESSING

34

$20.00

 

 

 

 

 

$827.00

 

 

$41.35

 

 

$868.35

 

 

 

***THANK YOU FOR YOUR ORDER - HAVE A NICE SUMMER!***

The FIRST-NAME, LAST-NAME, STREET, CITY, STATE, DATE, AMOUNT, TAX, and TOTAL.AMT items are single-valued items. Their positions on the form are defined with the @A code and x-y coordinates.

The TITLE, NUM, and PRICE items are MultiValued items. A window is created for them with the @W code and x-y-z coordinates.

When the form is printed on preprinted paper, it may look something like this: