LIST Command

The LIST command produces a formatted report which can be displayed on the screen or sent to the printer. These reports can display items from either the data file or the file dictionary. The LIST command is one of the most frequently used INFO/ACCESS commands.

Format

LIST [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 included in the report. selection has this syntax:

WITH [{EVERY | EACH}] attribute-name [[rel-op] value-list] [{AND | OR} attribute-name [[rel-op] value-list ]]

EVERY | EACH

Specifies that all values in a MultiValued attribute must meet the specified condition if the item is to be included in the report.

attribute-name

Name of the attribute whose data values are to be compared to the specified condition.

rel-op

Can be any relational operator. For a complete list of relational operators, see the section Connectives, Modifiers, and Options in the INFO/ACCESS User Reference Guide.

value-list

Can be either one or more data values, or a constant. Values should be enclosed in double quotes.

AND | OR

Specifies a compound expression.

output

List of attributes to be included in the report. output can also be a user-defined 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 specify the report format. These parameters affect headers, footers, spacing, totalling column figures, control breaks, and more. 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

The LIST command displays information in columnar and noncolumnar format. In addition, unless you use the ID-SUPP modifier, this command automatically displays item-IDs as the first column in the display.

If the Account Definition item in the SYSTEM Dictionary contains a Q in line 9, or if the Q option is specified in the INFO/ACCESS statement, item-IDs and data values need not be enclosed in quotation marks.

The SORT command is another of the most frequently used INFO/ACCESS commands. SORT generates reports similar to those produced by the LIST command, and also sorts items in alphabetical or numeric order.

Listing File Items

The following example displays the item-IDs in the ORDERS file:

>LIST ORDERS

 

PAGE   1                  14:01:22  dd mmm yyyy

ORDERS....

10116

10107

10119

10110

10122

10101

10113

10104

10105

10108

10120

10111

10123

10102

10114

10106

10109

10121

10112

10124

The next example displays four items in the ORDERS file and lists them by last name and first name:

>LIST ORDERS '0101' '10102' '10105' '10106' LAST-NAME FIRST-NAME

 

 

PAGE 1

14:05:15  dd mmm yyyy

 

 

 

ORDERS....

LAST NAME...

FIRST NAME....

 

 

 

10101

JOHNSON

ALICE

10102

LEARY

BILL

10105

EDGECOMB

DAVID

10106

ORLANDO

AMY

 

 

 

4 ITEMS LISTED.

>

 

 

Note that the preceding query included two attribute names (the output parameter) to specify which attributes should appear in the display.

Listing Items that Meet Selection Criteria

The following example displays the first and last names of all customers from the ORDERS file whose last name is LEARY:

>LIST ORDERS WITH LAST-NAME "LEARY" LAST-NAME FIRST-NAME

 

 

PAGE 1

14:07:43  dd mmm yyyy

 

 

 

ORDERS....

LAST NAME...

FIRST NAME....

 

 

 

10108

LEARY

BILL

10102

LEARY

BILL

10114

LEARY

BILL

10112

LEARY

BILL

 

 

 

4 ITEMS LISTED.

>

 

 

Printing a Report

The following example uses a selection expression to display a list of all book orders which total over $100.00. The query also specifies a heading that includes the name of the report and the date.

>LIST ORDERS WITH TOTAL-AMT  > "100" CODE NUMBER SHORT-TITLE AMOUNT TOTAL-AMT HEADING "LARGE ORDERS AS OF 'D'"

 

 

 

 

 

 

LARGE ORDERS AS OF dd mmm yyyy

ORDERS

CODE.

NUMBER

SHORT.TITLE

AMOUNT..

TOTAL

 

 

*

 

 

 

10107

N01

9

DATABASE

$761.00

$799.00

 

N02

34

OPERATIN

 

 

1011

N02

3

OPERATIN

$1088.00

$1142.00

 

QR01

45

WRITING

 

 

 

QR02

1

WORD PRO

 

 

 

N01

12

DATABASE

 

 

10113

N02

4

OPERATIN

$340.00

$357.00

 

QR02

13

WORD PRO

 

 

10104

N01

3

DATABASE

$827.00

$868.00

 

N02

5

OPERATIN

 

 

 

QR01

1

WRITING

 

 

 

QR02

34

WORD PRO

 

 

10105

N01

1

DATABASE

$229.00

$240.00

 

QR01

4

WRITING

 

 

 

QR02

7

WORD PRO

 

 

10108

N02

10

OPERATIN

$240.00

$252.00

 

QR01

2

WRITING

 

 

10120

QR01

8

WRITING

$160.00

$168.00

10111

N02

6

OPERATIN

$120.00

$126.00

10109

QR02

7

WORD PRO

$140.00

$147.00

10120

QR0

4

WRITING

$220.00

$231.00