LIST command

Used to output data from an ACL table as a list formatted in columns.

Syntax

LIST {<FIELDS> field_names|ALL} <LINE number field_list>
<TO SCREEN|filename||PRINT> <UNFORMATTED>
<IF test> <WHILE test> <FIRST|NEXT range>
<HEADER header_text> <FOOTER footer_text> <SKIP lines> <EOF> <APPEND>

Parameters

FIELDS field_names | ALL

Specifies the fields to include in the output. You can specify the individual fields to include, or use the ALL keyword to include all fields. The FIELDS keyword can be omitted.

LINE number field_list

Specifies that more than one line should be used in the output for each record. The number parameter indicates the line number, and the field_list parameter specifies the fields to include on that line. The number parameter value must be between 2 and 60.

TO SCREEN | filename | PRINT
  • Specify TO SCREEN to display the results in the ACL display area. This is the default output if the TO parameter is not specified.

  • Specify TO filename to write the results to a file. You must specify the filename value as a quoted string with the appropriate file extension. For example, specify the .TXT file extension to create a text file.

    For example: TO "Output.TXT"

    You can also specify an absolute or relative file path to an existing folder to write the file to.

    For example: TO "C:\Output.TXT" or TO "Results\Output.TXT"

  • Specify TO PRINT to send the results to the default printer.

UNFORMATTED

Specifies that the output should be unformatted text. Specifying this parameter creates output identical to that created by the EXPORT ASCII command. Unformatted data can be output to a file for further processing by other software programs.

IF test

Optional. Specifies a condition that must be met. The command is only executed on records that pass the test.

WHILE test

Optional. Specifies that the command should only be executed while a condition is true. The command processing terminates as soon as the specified test evaluates as false, or the end of the table is reached.

FIRST | NEXT range

Optional. Specify FIRST to start processing at the first record or NEXT to start processing at the currently selected record. Use the range value to specify the number of records to process.

HEADER header_text

Optional. Specifies the text to insert at the top of each page of a report. The header_text value must be specified as a quoted string. The value overrides any value set for the ACL HEADER system variable.

FOOTER footer_text

Optional. Specifies the text to insert at the bottom of each page of a report. The footer_text value must be specified as a quoted string. The value overrides any value set for the ACL FOOTER system variable.

SKIP lines

Causes ACL to insert the specified number of blank lines between each record in the list. For example, LIST ALL SKIP 1 produces a double spaced list (one blank line between each record).

EOF

Optional. Specifies that the command should be executed one more time after the end of the file has been reached. This parameter is sometimes necessary to ensure that the final record in the table is processed when you are processing the records with a GROUP command. It should only be used if all fields are computed fields referring to earlier records.

APPEND

Optional. Specifies that command output should be appended to the end of an existing file instead of overwriting the existing file. You must ensure that the structure of the two files is identical when using this parameter, if maintaining a consistent file structure is important (e.g., when you are appending data to an existing ACL table), because ACL appends output to an existing file regardless of its structure.

Remarks

You can use the LIST command to print data, display data on screen, to export it to a file.

Unless you specify the UNFORMATTED parameter, page numbers, date, time, user identification, and column headings are included automatically. Numeric columns are also automatically totalled.

Examples

The following example uses the LIST command to create a report listing exceptions identified in an inventory table. The report is saved as a text file.

LIST Product_number Description Quantity Unit_cost Value 
IF Quantity < 0 OR Unit_cost < 0 HEADER "Negative Values" 
TO “Exceptions.txt”


(C) 2013 ACL Services Ltd. All Rights Reserved. | Send feedback