ACCESS / AQL
108 topics in this section.
A
Access Query Language
The Access Query Language (AQL) is a D3 facility used to retrieve and output data. It is an original component of the D3
Access Query Language overview
AQL uses TCL commands and displays the results either on terminals or printers. AQL operates on specified files and item
after operator gt
The after relational operator represents a greater than condition used in constructing selection clauses. The gt and > o
and clause
The and clause is used between selection criteria clauses to indicate that both condition being evaluated as true select
any modifier
The any modifier searches an entire item for a match, all attributes and all values. Each value is compared to the selec
AQL command categories
AQL commands essentially break down into these categories:
AQL commands
The following AQL commands are available.
AQL modifiers
The following AQL modifiers are available.
AQL relational operators and logical clauses
This section presents information for each of the AQL relational operators and logical clauses.
AQL sentence form
In an AQL sentence, the command and file reference are required. The AQL command must be the first word of the sentence.
AQL user exits
User exits allow direct access to system functions.
B
before operator lt
The before relational operator represents a less than condition used in constructing selection clauses. The < and lt ope
break-on modifier
The break-on modifier creates a visual break in output data when the value in the current output field is different from
by modifier
The by modifier designates a sort key, in ascending order, and must be followed by an attr.name. It may be used with any
by-dsnd modifier
The by-dsnd modifier designates a sort key, in descending order and must be followed by an attribute name. It may be use
by-exp modifier
The by-exp modifier designates a sort key, in ascending, exploded MultiValue order and must be followed by an attribute
by-exp-dsnd modifier
The -by-exp-dsnd modifier is followed by an attribute name that references a MultiValue attribute to be used individuall
C
check-sum command
The check-sum command calculates a hexadecimal checksum for a specified attribute, or the entire item if no attribute is
col-hdr-supp modifier (c
The col-hdr-supp modifier suppresses column heading above output columns and default page heading on AQL reports.
conv modifier
The conv modifier substitutes the conversion codes specified in conversion for attribute 7 of the specified Attribute-De
converting-nulls modifier (m
The converting-nulls modifier allows all values (including nulls) to be processed by the output-conversion. Normally, nu
count command
The count command produces a total of the number of items that meet the selection criteria as determined by the item.lis
D
dbl-spc modifier
The dbl-spc modifier double-spaces output by inserting a blank line between items.
Default attribute items (Access Query Language)
Default attribute items have numeric item-IDs starting with 1.
Default output specifications
In addition to explicitly listing attribute names as part of the AQL sentence, there are three features that can be used
det-supp modifier (d
The det-supp modifier suppresses the detail lines in a report. It provides the ability to easily fold detailed informati
dict modifier
The dict modifier is used immediately preceding a file name and affects the dictionary level of the specified file rathe
E
equal operator eq
The equal operator represents an equal to condition used in constructing selection clauses. When a valuestring is includ
eval modifier
The eval modifier performs the operation specified in the expression on the specified Attribute-Defining-Items. The expr
every modifier each
The every modifier forces comparison on every value, rather than any value.
F
File reference (Access Query Language)
A file reference is a standardized mechanism for designating a particular file within D3.
fill modifier (r
The fill modifier forces listings into an across-the-page format if the listing would otherwise be noncolumnar. The head
fmt modifier
The fmt modifier substitutes the column heading, justification and width settings specified in "{'<column-heading>&#
footing modifier footer
The footing modifier designates a text string composed of literals and special options to output at the bottom of each p
G
ge operator >=
The ge relational operator represents a greater than or equal to condition used in constructing selection clauses.
grand-total modifier
The grand-total modifier substitutes a string of text in place of the standard "***" literal string normally output on t
gt operator after
The gt operator is a greater than relational operator.
H
hash-test command
The hash-test command produces a histogram, or graphic representation of item-ID distribution within a given file, accor
hdr-supp modifier supp
The hdr-supp modifier suppresses the default page heading (system time/date and page number) on output.
heading modifier header
The heading modifier designates a text string composed of literals and special options to output at the top of each page
I
id-supp modifier (i
The id-supp modifier suppresses the automatic display of item-IDs in the leftmost column of an AQL report.
ifno modifier
The ifno modifier is the same as indicating with no or with not in an AQL sentence.
Index utilization in selection criteria
Indexes can be used with the following types of selection criteria:
istat command
The istat command produces a graphic representation of item-ID distribution within a file and suggests a new modulo. The
Item list
The item list specifies one or more item-IDs in the file defined by the associated file reference.
L
le operator <=
The le operator selects items whose specified attribute name contains a value less than or equal to the specified value
legend-supp modifier leg-supp
The legend-supp modifier suppresses the output of the legend on list and sort operations directed to the spooler.
list command l
The list command generates formatted output based upon the specified arguments. If an item list is specified, items are
list-item command (Access Query Language) li
The list-item command displays items in their internally stored format. The list-item command combines the action of the
list-label command
The list-label command produces one or more columns of output.
locking modifier
The locking modifier locks an item for AQL report processing. The purpose of this modifier is to prevent transient GFEs
lptr modifier (p)
The lptr modifier directs output of AQL sentences to the system printer, via the spooler. The output is directed accordi
lt operator before
The lt operator selects items whose specified attribute name contains a value less than the specified value string.
M
N
ne operator #
The ne operator selects items whose specified attribute name contains a value not equal to the specified value string.
ni-supp modifier (j
The ni-supp modifier suppresses the number of items listed message at the end of most AQL reports.
no operator without
The no operator reverses selection condition.
nopage modifier (n
The nopage modifier prevents terminal output from pausing at the end of each page. CTRL+X, which terminates a report whe
not operator #
The not operator represents a not equal to condition. This reverses the true sense of the condition in a selection crite
nselect command
The nselect command selects items that would fail the selection criteria of a select. When an output list displays in an
O
oconvs() function
See eval modifier for more information.
only modifier
The only modifier ignores default attribute-defining items and displays only the item-IDs from the given file reference.
Options (Access Query Language)
Options are used to alter the behavior of AQL sentences.
or clause
The or clause is used between selection criteria clauses to indicate that either condition being evaluated as true selec
Output specifications
Output specifications specify the attributes to list.
P
Q
R
reformat command
The reformat command takes values from the attributes specified in the command and places them either in another file or
Relational operators and logical clauses
Relational operators are modifiers used to establish criteria based on the relationship of data to fixed values or other
require.select command
The require.select command is used with any AQL sentence when you want to process a select list.
Retrieval of items from files
The AQL processor uses both the master dictionary and the file dictionary to determine the definition of the elements in
roll-on modifier total-on
The roll-on modifier creates a visual break in output data when the value of a specified attribute changes; an improveme
S
sampling modifier
The sampling modifier limits the number of items processed by the AQL sentence to a specific number. If selection criter
select command
The select command retrieves all items from the specified file reference that meet the optional selection criteria. The
Selection criteria
Selection criteria determines which items are to be processed by AQL and is designated by the with or if modifiers. With
show-nulls modifier
The show-nulls modifier allows the display of empty multivalues.
sort command
The sort command generates sorted and formatted output of selected items and attributes from a specified file. The outpu
Sort criteria
A sort criteria defines the AQL collation sequence. The sort is invoked by the by, by-dsnd, by-exp, or by-exp-dsnd modif
sort-item command si
The sort-item command displays items in their internally stored format, in order of the given sort-key. The sort-item co
sort-label command
The sort-label command produces one or more columns of output in order of the specified sort-key. The sort-label command
sreformat command
The sreformat command moves the sorted values from the attributes specified in the AQL sentence and places them either i
ss modifier
The ss (spreadsheet) connective allows printing out AQL reports in spreadsheet format. This is achieved by adding the ss
sselect command
The sselect command creates a sorted list of items from the specified file reference that meet selection criteria.
stat command
The stat command outputs the total number of items processed and an average value of all items that meet the specified s
String searching
AQL permits the use of string searching (sometimes called wildcards), that allows introducing variables into the selecti
sum command
The sum command produces a numeric total of a given attribute for all items meeting the optional selection criteria. If
T
tape modifier
The tape modifier retrieves data from the currently attached tape, rather than the actual data level of the file. The ta
tcl-supp modifier
The tcl-supp modifier suppresses the display of the AQL (TCL) sentence used to generate the report on printed output onl
Temporary attribute items
Attribute items using special attribute names can be specified in an AQL sentence without actually existing in either th
Throwaway connectives
Throwaway connectives are a class of AQL modifiers that have no effect on command execution.
total modifier
The total modifier accumulates a columnar total for a specified attribute-defining item.
trans() function
See eval modifier for more information.
U
u1070 user exit
The u1070 user exit returns a checksum for the current item.
u201e user exit
The u201e user exit returns the number of attributes in an item.
u2070 user exit
The u2070 user exit returns the checksum value for the specified frame.
u3070 user exit
The u3070 user exit returns the PCB FID for the current process as four hexadecimal digits.
u5070 user exit
The u5070 user exit converts a string to the form: string[1,3]: "-000"
u508e user exit
The u508e user exit calls the copy processor from AQL. Headings and footings may be included. This is the same as list-i
u6070 user exit
The u6070 user exit inputs up to 100 characters. A CR/LF is output immediately after the : prompt character, which displ
u7070 user exit
The u7070 user exit inputs up to 100 characters.
u9070 user exit
The u9070 user exit toggles the page/nopage format. This is the same as activating the AQL n option.
ua070 user exit
The ua070 user exit returns the specified value from a MultiValue set. The value count (the nth value to return) follows
uc070 user exit
The uc070 user exit returns the specified value from a MultiValue set.
using modifier
The using modifier allows AQL to report on the data in a given file using attribute-defining items from a different file
W
with modifier if
The with modifier marks the beginning of a selection processor conditional, which is processed against the associated fi
within modifier
The within modifier retrieves a list of all the items that are subitems of a specified item. This is used to explode one
without modifier
The without modifier negates the normal rules for selection criteria. if no, with no, and with not are identical to with