GAPS command

Used to detect whether key numeric or datetime fields in the current ACL table contain one or more gaps in their sequences.

Syntax

GAPS <ON> key_field <D> <UNFORMATTED> <PRESORT> <MISSING limit>
<HEADER header_text> <FOOTER footer_text> <IF test> <WHILE test>
<{FIRST|NEXT} range> <TO SCREEN|table_name|filename|PRINT> <APPEND>
<LOCAL> <OPEN>

Parameters

ON key_field

Specifies the fields or expressions to check for gaps. The ON parameter can be omitted.

D

Optional. Specifies that key fields should be sorted in descending order. The default sort order is ascending.

UNFORMATTED

Optional. Specifies that page headings and page breaks should not be included when the results are output to a file.

PRESORT

Optional. Sorts the primary table on the primary key before executing the command. You cannot use PRESORT inside the GROUP command.

MISSING limit

Optional. The MISSING parameter specifies that the output results contain individual missing items rather than gap ranges. The limit value specifies the maximum number of missing items to report for each identified gap. The default value is 5. If the limit is exceeded for a particular gap, the missing items are reported as a range for that particular gap. The limit value does not restrict the total number of missing items reported, it only restricts the number of missing items reported within a specific gap.

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.

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.

TO SCREEN | table_name | 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 table_name to write the results to an ACL table. You must specify the table_name value as a quoted string with a .FIL file extension to create an ACL table.

    For example: TO "Output.FIL"

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

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

  • 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.

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.

LOCAL

Optional. Specifies that the output file should be saved in the same location as the ACL project. This parameter only applies when the command is run on an ACL Server table and the output file is an ACL table.

OPEN

Optional. Specifies that the table created by the command should be opened after the command executes. This parameter is only valid if the command creates an output table.

ACL output variables

GAPDUPn

Stores the total number of gap ranges, or missing items, identified by the command.

Example

The following example uses the GAPS command to ensure that there are no invoice numbers missing from an Invoices table.

OPEN Invoices
GAPS ON Inv_Num PRESORT TO "Invoices_Gaps.fil"


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