SREPT Command

The SREPT command, like the SFORMS command, prints file items on such forms as invoices, checks, and order forms in sorted order. Unlike the FORMS and SFORMS commands, which list one item per page, SREPT (and REPT) can list multiple items as subpages on a single page.

Using SREPT allows you to explicitly position data either on the terminal or on a printer page according to x- (column) and y- (row) coordinates.

Format

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

Parameter(s)

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 output on the form. Each attribute specified to be output must be associated with a print code. All forms generation statements must contain at least one print code. Print codes are described in the Print Codes section below.

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.

The following modifiers behave somewhat differently when used with forms generation commands: BREAK-ON, FOOTING, HDR-SUPP, HEADING, and ID-SUPP. These modifiers are described in the Forms Generation Modifiers section of the REPT Command.

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 REPT Command):

A

Allows you to check printer alignment.

B

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

Z

On multipage forms, resets footing page number to one.

Description

After the SREPT command is entered, the system prompts for subpage size:

Subpage size>

Enter the number of lines each subpage should contain. For example, to define 6 subpages on each page of 62 lines (2 lines are reserved for the heading), type 10. Each subpage extends the full width of the page.

The system does not split items; if an entire subpage will not fit at the bottom of a page, the system prints the subpage on the next page.

The SREPT command applies the format specified in the command line to the output specifications. SREPT 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 SREPT command can be used to specify the layout of the form itself.

Formatting codes can be used to define vertical windows in which the data for MultiValued attributes can be output. If 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 FORMS and SFORMS commands print items or forms in sorted order. 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]

Parameter(s)

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 table 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 bottommost row of a window whose top-most row is defined by y.

You must add an S to the end of the x parameter for an attribute to appear on every second output line.

@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 Subpages of a Form

The following example sorts items from the PAYROLL file by LAST-NAME and lists them on 11-line subpages on the screen. Eventually the items are printed on preprinted check forms:

>SREPT PAYROLL WITH ITEM-ID > "24535" BY LAST-NAME @(3,3):CHECK# @(60,3):DATE @(14,6):LAST-NAME @(3,6):FIRST-NAME @(3,9):LINE-AMT @(58,9):AMOUNT HDR-SUPP

 

 

Subpage size:11

 

 

  24536   08/27/1988

 

 

 GEORGE     BELOSILSKY

 

 

Eight hundred ninety-eight dollars and forty-five cents   $898.45

 

 

 

  24539   08/27/1988

 

 

  VLADIMIR   HARCOURT

 

 

  Nine hundred forty-two dollars and sixty-four cents   $942.64

 

Each item’s position on the form is defined with the @A code and an x-y coordinate.

When the forms are printed on preprinted paper, they may look something like this: