REPT Command

The REPT command, like the FORMS command, prints file items on such forms as invoices, checks, and order forms. Unlike the FORMS and SFORMS commands, which list one item per page, REPT (and SREPT) can list multiple items as subpages on a single page. Using REPT allows you to explicitly position data either on the terminal or on a printer page according to x- (column) and y- (row) coordinates.

Format

REPT [DICT] filename [item-list] [selection] 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.

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 below in the Print Codes section.

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 below in the Forms Generation Modifiers section.

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 non-standard options are described below in the Forms Generation Options section.):

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.

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

The @W and @D print codes (described later) enable you to define vertical windows in which the data for MultiValued attributes can be output. If the data in 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.

As previously mentioned, the FORMS and SFORMS commands print items or forms in sorted order. REPT and SREPT 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 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.)

When you use the @C print code, the system prompts for the audit file and starting number:

Audit File>

Enter the name of an existing file that will be used to track each form that is generated.

Starting Number>

Enter the starting serialization number for the forms. This number appears on the form at the position specified for the @C-formatted attribute. The information on each form will be stored as an item in the audit file.

See the section Forms Generation, in the INFO/ACCESS User Reference Guide for more information about audit trails.

@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 topmost 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.

The system does not check whether output data exceeds the page width set by the TERM command. The justification (TP) of the specified attribute in combination with the maximum number of characters (MAX) and the column position (specified by x) determine the width of the data displayed on the form.

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

Forms Generation Modifiers

When used with forms generation commands, the following modifiers behave somewhat differently than they do with other INFO/ACCESS commands. For more information about how these modifiers work with forms generation commands, see the section Forms Generation, in the INFO/ACCESS User Reference Guide.

BREAK-ON

The data line for the BREAK-ON modifier is treated like any other output specification when it is printed.

Generally, forms generation commands will not use the BREAK-ON, TOTAL, and GRAND-TOTAL modifiers.

HEADING and FOOTING

Headings and footings cannot output on a form using x-y coordinates; they are output in separate reserved areas. Conversely, data specified by the output parameter cannot be placed in the areas reserved for headings and footings. By default row 0 is reserved for headings and row 1 is reserved for a blank line that separates the heading from the report. If a multiple-line heading is specified for either headings or footings, the system reserves the number of lines needed for the text. The blank line is replaced by the specified multiple-line heading.

HDR-SUPP

Forms generation commands automatically suppress column headings, but they still generate the one-line heading that lists the time, date, and page number. HDR-SUPP suppresses this one-line heading.

ID-SUPP

Forms generation commands automatically suppress item-IDs, so this modifier is unnecessary in a forms generation statement. If you want to include item-IDs on a form, create an item in the dictionary that has an attribute number (A/AMC) of 0. Then include an output specification referring to this item in the forms generation statement.

Forms Generation Options

The following non-standard options can be specified with REPT: A, B, and Z.

The A Option

The A option is used to verify the page layout before the actual forms are generated. The A option runs a printer-alignment routine. This routine prints the first form on the terminal screen or printer, showing text (except for headings and footings) as Xs. This option can be used only if the current SP-ASSIGN statement includes the C and the I options. (See the SP-ASSIGN Command for more details.)

The following prompt appears if the A option is included in the forms generation statement:

Align? Y=cr/N>

Before you respond to this prompt, manually set the printer at the top of the form. Then press ENTER to display or print the data as Xs. Type N to simply print the forms.

The B Option

B prints a background form composed of previously created text or graphics. It is printed on every page of a form. To use the B option, you must already have created a background form (background forms are created with the Editor). This background form can be used to print forms on standard paper instead of on preprinted forms. Background forms also make it possible to use printer control characters (for underlining, etc.) that apply to specific printers.

Design a background form so that it is not overwritten by the reserved heading rows 0 and 1, and does not overwrite the data placed on the form with print codes.

The following prompt appears if the B option is included in the forms generation statement:

Background File & Item:

Enter the name of the background file item using the following format:

[DICT] filename item-ID

The Z Option

Z is used with the FOOTING modifier. It resets the page number in the footing back to 1 at the beginning of each multipage form. Use the HDR-SUPP modifier with the Z option to prevent an incompatible (not reset) page number from appearing in the heading.

Listing Items on Subpages of a Form

The following example lists items from the PAYROLL file in a form on 11-line subpages on the screen. Eventually the items will be printed on preprinted check forms:

>REPT PAYROLL WITH ITEM-ID > "24535" @(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 and y coordinate.

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