SORT-LABEL Command

The SORT-LABEL command allows you to specify a format for specialized block listings such as mailing labels, and to display or print them in sorted order. SORT-LABEL can be used to define how many blocks (or items) are displayed across each page or screen and how many rows (or attributes) are displayed for each block.

SORT-LABEL also defines the number of vertical lines and horizontal spaces between blocks, the amount of indent from the left margin of the page or screen, and the maximum width of a row.

Format

SORT-LABEL [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. The system sorts these items in the order that you specify with sort-keys.

selection

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

sort-keys

Specify which attributes to sort and whether to sort them in ascending or descending order. See the SORT Command for a complete list of the modifiers used to define sort-keys.

output

Those attributes to be included in the report. By default, the SORT command displays only item-IDs. output can also be a user-defined phrase that contains any INFO/ACCESS parameters except a command or file name.

print

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

modifiers

Include one or more keywords that specify the report format. These parameters affect headers, footers, spacing, totalling column figures, control breaks, and more. To produce a continuous form report (one with no page breaks) use the COL-HDR-SUPP modifier (or (C) option). This modifier also suppresses the header (page number, time, and date) at the top of the report. For complete information about using these keywords, see the section, Connectives, Modifiers, and Options 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.

Description

After the SORT-LABEL command is entered, the system displays the following prompt:

?

You can now determine the format of the label. Enter a response in the following format:

Format

count, rows, skip, indent, size, space [,C]

Parameter(s)

count

Number of labels (items) across each page or screen.

row

Number of lines printed for each label. Remember to count the item-ID as one line. The item-ID is automatically included in the labels unless you use the ID-SUPP modifier in the query.

skip

Number of lines to skip vertically between labels.

indent

Number of indented spaces from the left margin to the label. Zero (0) is a valid response.

size

Maximum width for the data contained in each attribute (in other words, the width of each label in columns).

space

Number of horizontal spaces between labels.

C

Specifies that null attributes should not be printed. Otherwise, null attributes appear as all blanks. This parameter is optional.

The size parameter cannot exceed the current page width (80 characters for terminals, and 80/132 characters for printers). Calculate label width as follows:

(count * (size + space) + indent) <= (current page width)

 

current page width

Value defined by the TERM or SET-TERM commands for the terminal or printer.

If a value other than zero is specified for the indent parameter, the system prompts you to define headers for each row in a label:

?

The number of ? prompts corresponds to the value entered earlier for rows. At each ? prompt, enter the desired header. To avoid defining a header, simply press ENTER. Defined headers appear at the left margin in the indent area of the listing.

Sorting Items in a Mailing Label Format

The following example defines a format for a customer mailing, using sheets of mailing labels that have three labels in each horizontal row:

>SORT-LABEL CUSTOMERS BY ZIP FULL-NAME STREET CITY-ST ZIP ID-SUPP (C)

?3,4,2,0,20,5,C

 

 

 

BUCKLER,JULIE

BOHANNON,JOHN

EDGECOMB,DAVID

26 STONE AVE.

126 TREMONT ST.

338 BROADWAY

LINCOLN,IN

BOSTON,MA

MIAMI,FL

02144

21300

39007

 

 

 

JOHNSON,HENRY

JENKINS,HAROLD

PEERCE,JAN

45 5OTH ST.

1222 MAIN ST.

89 RIALTO WAY

OMAHA,NB

INDIANAPOLIS,IN

LOS ALTOS,CA

39977

48865

57685

 

 

 

LEARY,BILL

PIRS,SANDRA

ORLANDO,AMY

34 TREMONT ST.

112 APPLEBEE RD.

55 VENTURA HWY

BOSTON,MA

WINSTON,NC

VENICE,CA

74332

88945

89456

 

 

 

ASH,MARY

JOHNSON,ALICE

 

912A E. OAK ST.

760 JEFFERSON STREET

 

INDIANAPOLIS,IN

LOUISVILLE,KY

 

98754

99475

 

In the example above, the SORT-LABEL command defines a label format that consists of three labels across a page, four lines displayed for each label, two lines skipped between labels, no indented space from the left margin, a maximum of twenty characters for each attribute, five horizontal spaces between each label, and a continuous form report. This example also suppresses item-IDs. The labels are printed in numeric order by zip code.