UNISYS-Enterprise Database Server Inquiry Operations Guide
UNISYS-Enterprise Database Server Inquiry Operations Guide
You should be very careful to ensure that the use of this information and/or software material complies with the
laws, rules, and regulations of the jurisdictions with respect to which it is used.
The information contained herein is subject to change without notice. Revisions may be issued to advise of such
changes and/or additions.
Notice to U.S. Government End Users: This is commercial computer software or hardware documentation developed
at private expense. Use, reproduction, or disclosure by the Government is subject to the terms of Unisys standard
commercial license for the products, and where applicable, the restricted/limited rights provisions of the contract
data rights clauses.
Unisys and ClearPath are registered trademarks of Unisys Corporation in the United States and other countries.
All other brands and products referenced in this document are acknowledged to be the trademarks or registered
trademarks of their respective holders.
Contents
Section 1. Introduction
iv 8807 6120–004
Contents
Index ............................................................................................. 1
8807 6120–004 v
Contents
vi 8807 6120–004
Tables
The Enterprise Database Server Inquiry program provides an on-line, interactive system
that can be used to examine or modify information contained in an Enterprise Database
Server database. Inquiry contains a small number of input statements, which can be
combined to perform complex operations. Thus, the design of Inquiry allows database
users who are relatively unfamiliar with database design concepts to effectively access
and use the information contained in Enterprise Database Server databases.
• Examination of database information. Inquiry users may examine either the contents
of a database or the database description from remote terminals. Inquiry is able to
access information in any part of a database, regardless of the complexity of the
database, and is always able to produce the requested information, even if linear file
searches must be performed. Whenever possible, Inquiry takes advantage of sets
when accessing database information.
• Database modification. Inquiry users may use input statements to modify, create, or
delete records within databases. (Database administrators may use DASDL remaps
and logical databases to define which parts of a database allow Inquiry access and
which users may access these parts.)
• Report generation. The Inquiry Report facility allows simple reports to be generated
from database information.
• Extraction of database information. The Inquiry Extract facility allows selected
database information to be extracted to a standard data file.
• Allows sectioned and non-sectioned XE structures.
Purpose
This guide is designed to provide both a description of the operations required to use the
Inquiry program and formal syntactic and semantic descriptions of statements used as
input to the program.
Audience
This guide is written for end users wishing to perform ad hoc queries against an
Enterprise Database Server database or wanting to view the database schema. No
programming knowledge is required.
Prerequisites
The reader is assumed to have a basic understanding of the concepts and terminology
associated with the Data and Structure Definition Language (DASDL), including items,
records, sets, data sets, embedded sets, disjoint sets, and keys.
Documentation Updates
This document contains all the information that was available at the time of
publication. Changes identified after release of this document are included in problem
list entry (PLE) 18911612. To obtain a copy of the PLE, contact your Unisys
representative or access the current PLE from the Unisys Product Support Web site:
http://www.support.unisys.com/all/ple/18911612
Note: If you are not logged into the Product Support site, you will be asked to do so.
What’s New?
The following table identifies new and revised information for this release.
This section illustrates the operations involved in the selection, display and modification
of database records using Inquiry and in the use of the Inquiry Report and Extract
facilities.
For all examples in the following two sections that display both user input and Inquiry
output, user input is indicated by an arrow (->). In addition, output examples are
displayed for a terminal width of 70 characters.
Sample Database
The following DASDL input creates the database that is used for the examples in the
remainder of this manual:
The Inquiry program may be used to select database records and to display items within
those records. The desired records must be present within a designated structure or
must satisfy conditions, known as selection conditions, specified in Inquiry input
commands.
If Inquiry fails to find a record that satisfies the user’s specification, the following
message is displayed:
#NONE
If Inquiry finds a record that satisfies the user’s specification, a number sign (#) is
displayed. If the user then wishes to display the selected record, or items within the
selected record, the DISPLAY command is entered. If the user wishes to locate the next
record that satisfies the specification, the NEXT command is entered; then, if another
record satisfies the specification, Inquiry again displays a pound sign and awaits further
input. This process continues until no more records meet the user’s specification. At that
point, Inquiry displays the following message:
#NO MORE
Examples
In the following example, Inquiry is asked to select the first record in the data set EMP
that applies to an employee hired after December 25, 1955:
Next, Inquiry is asked to display the date the employee was hired, the employee-number
of the employee, and the last name of the employee:
Each succeeding record that meets the condition specified may then be selected in turn,
and the specified information may be displayed until no additional records in EMP meet
the specified condition, by using the NEXT and REPEAT commands as follows:
-> NEXT
#
In this context, the NEXT command instructs Inquiry to select the next record that meets
the specified condition. The REPEAT command can then be used to display the desired
information from the newly selected record without having to re-enter the DISPLAY
command:
-> REPEAT
EMP-DATE-HIRED EMP-NO EMP-LNAME
-------------- ------ ----------
701214 2 HARDWICK
#
.
.
.
-> NEXT
#NO MORE
#
The NO MORE display indicates that no records remain that meet the specified
condition.
Record Selection
The user selects records using Inquiry by specifying selection conditions involving
database records and items, or by designating an access structure.
If any part of the selection condition contains an item declared as a key of a set, then
Inquiry attempts to use that set to find the requested records. If a set has been specified
in the selection condition, Inquiry uses the set to retrieve the selected records. If a set
was not specified, Inquiry chooses the set (if one exists) whose high-order keys have the
best match with the items in the selection condition. Whenever possible, Inquiry
optimizes the use of the set by starting at the first key value before reading any data set
records.
However, if the set has a group item key that is not the only key of the set, then Inquiry
searches through the entire set (that is, performs a linear search) to find the requested
records. To avoid this situation, whenever you want to use a group item as one of the
keys in the set, declare the individual items of the group as the keys rather than
declaring the group itself.
Selection Conditions
Inquiry locates all records that satisfy the user-specified selection condition. Selection
conditions are defined under “Selection Condition” in Section 3. A simple selection
condition has the following form:
In this form, <value> may either be a numeric value or the result of an arithmetic
expression. Relational operators and arithmetic expressions are defined under
“Selection Condition” in Section 3.
The logical operators AND, OR, and NOT can be used to form more complex selection
conditions.
Examples
The following SELECT command selects records in the data set ADR for addresses
containing zip codes that are not equal to 50007:
The following SELECT command selects records in the data set EMP for employees
hired before 1965 and who do not earn more than $3000 per month:
The following SELECT command selects records in the embedded data set EMP-ED for
employees who attended Harvard or whose grade-point averages were greater than 3.5:
In the preceding example, a record must already have been selected from the master
data set EMP (refer to EMBEDDED STRUCTURES in this section); if not, Inquiry displays
the following message:
Structure Designation
A number of sets may be associated with each data set. Unless a particular structure is
designated, Inquiry attempts to locate records using these sets. Because subsets may
not locate all records contained in the data set, subsets are not used unless they are
specifically designated in the user’s request.
The user can force Inquiry to locate records using a particular data set, set, or subset by
specifying the name of the structure in the SELECT command. This procedure is known
as structure designation. If no sort specification is given, all records in the data set are
selected in the order in which they appear in the designated access structure.
Examples
The following SELECT command allows Inquiry to choose the best access method
possible to select records for employees in EMP with a last name of JONSON:
The following SELECT command does not specify a set or subset to be used to select
the specified record. Because no set specifies EMP-DATE-HIRED as a key, a linear
search of the data set EMP is performed.
Because the following command specifies the data set EMP, it causes Inquiry to
perform a linear search of the data set EMP, even though a set could have been used to
locate the record more efficiently:
Qualification
If two data sets in a database contain items with the same name, Inquiry does not
always require the user to specify the data set from which to select the item. If one of
the items is in the data set referenced by the selection condition (or one of its ancestors
or descendants), or in the last data set selected, that item is chosen. Otherwise, the user
is asked to specify the correct data set. Thus, the user is not required to qualify the item
every time it is used.
Inquiry indicates that a particular data set must be specified by displaying the following
message:
In the preceding list, <data set 1> through <data set n> are the names of the data sets
that contain the duplicated item name. The user must then input the number
corresponding to the desired data set; this process is known as qualification. Until a
different data set is requested, Inquiry continues to use the data set specified.
If the Inquiry user knows that a particular item is in more than one data set, the item can
be explicitly qualified by placing the word OF before the name of the desired data set.
For example, if the item EMP-NO were in both the data set EMP and the data set ADR,
one of the following qualification clauses would specify which item EMP-NO was
desired:
EMP-NO OF EMP
EMP-NO OF ADR
In addition, DISPLAY can cause Inquiry to function like a calculator by displaying the
results of arithmetic expressions and certain arithmetic functions involving constants.
When Inquiry is used in this way, it is said to be in calculator mode.
Examples
A record is selected for an employee in the EMP data set:
Next, the item containing the salary for the employee is displayed:
EMP-SALARY
----------
2450.00
#
Next, the employee’s number, Social Security number, and date of hire are displayed:
The following example illustrates the Inquiry calculator mode. The DISPLAY command in
the example lists the value of the EXP function for the given arithmetic expression. (EXP
gives the value of “e” raised to the power of the given argument. Refer to
“Arithmetic Function” in Section 3 for more information.)
EXP
------------------
1.00814106784
#
Using this form of item display, all records that meet the selection condition are
displayed, so that NEXT need not be specified in order to display each record.
If the specified selection condition requires qualification, the clause specifying the
desired data set must appear immediately before the AT, IN, or WHERE specification.
The user may control the format of displayed output. (Refer to “Output Formatting” in
this section.)
Examples
The following DISPLAY command includes a selection condition specifying that the
required information is to be displayed only for employees hired after January 1, 1970:
JOB-TITLE
------------------------------
VICE PRESIDENT
CONTROLLER
ADM ASSIST
SALES MANAGER
PROJECT MANAGER
#
Embedded Structures
Data sets may appear as items within other data sets; such data sets are known as
embedded data sets.
To display an item in an embedded data set, a record from the data set in which the data
set is embedded (known as the master data set) must first be selected. Records must
be selected in ascending hierarchical sequence; that is, for each level of embedding, a
record must first be selected at the next higher level of embedding before a record from
the lower level may be displayed. A comma (,), the word THEN, or a comma followed by
the word THEN must be used to separate the SELECT and DISPLAY commands for each
level of nesting.
Because structures must be selected in an ascending hierarchical sequence, a DISPLAY
command may reference any structure previously selected at a higher level of nesting.
If items in embedded data sets require qualification, the qualification clauses may be
included in DISPLAY command specifications.
An embedded standard or compact data set can only be accessed through a set. In
Inquiry, a set used to access an embedded data set must be specified by the word VIA
or USING, followed by the name of the set.
Examples
In the following example, a record is first selected from the master data set EMP, and
then all EMP-ED records that are embedded in that EMP record are displayed (Inquiry is
instructed to use ED-DATE-SET by the VIA specification):
In the following example, selection conditions for the master data set EMP indicate the
records of EMP from which the specified embedded ED-DATE-SET records are
displayed:
-> SELECT EMP-SALARY > 2500 THEN DISPLAY ED-DATE-SET ED-GPA > 2.5
Use of Functions
Boolean functions and arithmetic functions may be used in SELECT and DISPLAY
commands. (These functions are defined in more detail under “Functions” in Section 3.)
Boolean Functions
The Boolean functions ANY and ALL allow the specification of conditions involving
embedded structures. The function ANY (<selection condition>) yields a value of TRUE if
any record embedded in a master data set satisfies the specified selection condition and
a value of FALSE otherwise. The function ALL (<selection condition>) yields a value of
TRUE if all records embedded in a master data set satisfy the specified selection
condition and a value of FALSE otherwise. The specified selection condition may be
complex.
Examples
The following example illustrates the use of the Boolean function ANY. The DISPLAY
command displays the names and records in the embedded data set ED-DATE-SET for
employees in the EMP data set who have attained a grade-point average of 4.0 at any of
the schools they have attended.
EMP-LNAME EMP-FNAME
---------- ----------
FIELDS JON
1:ED-DATE ED-INST-NAME ED-INST-CODE ED-COURSE
2:ED-GPA
-------------------------------------------------------------------
1: 610101 UNIV OF MARYLAND 5266 SOC SCI
2: 2.89
1: 650615 KENT STATE 2123 PSYCHOLOGY
2: 3.77
1: 690612 UCLA 2238 BUS ADM
2: 4.00
EMP-LNAME EMP-FNAME
---------- ----------
HARDWICK ALICE
1:ED-DATE ED-INST-NAME ED-INST-CODE ED-COURSE
2:ED-GPA
------------------------------------------------------------------
1: 450615 UNIV OF SO CAL 2125 HISTORY
2: 4.00
1: 650615 UCLA 2238 MBA
2: 4.00
#
The following example illustrates the use of the Boolean function ALL. The DISPLAY
command displays the names and salaries of all employees in the EMP data set whose
major subject was Philosophy at all schools attended, then displays the records in the
embedded data set ED-DATE-SET for these employees.
Arithmetic Functions
Arithmetic functions specify arithmetic operations involving structures, which produce
values that may be used in SELECT or DISPLAY command specifications. Arithmetic
functions are of two kinds: data set functions and current record functions.
To compute the values for data set arithmetic functions, Inquiry may need to access
every record of the specified data set; thus, a large amount of time may be used in
producing results. If the amount of time required to produce the results exceeds the
user’s expectations, the user can discontinue processing by entering the CANDE ?AX
command. The system then displays the following message and awaits additional input:
#STOPPED
Examples
The following example displays the names of all employees in the data set EMP whose
monthly salaries are greater than or equal to the average of all employees’ salaries:
EMP-LNAME EMP-FNAME
---------- ----------
FIELDS JON
HARDWICK ALICE
CHAPMAN GEORGE
JOYCE JAIME
#
The following example displays the last name of each employee in EMP and the
difference between the employee’s salary and the average salary of the employees in
EMP:
EMP-LNAME ABS
---------- ------------------
FIELDS 2.60444444418
HARDWICK 802.60444444
JONSON 475.835555556
DEKKER 297.395555556
CHAPMAN 557.60444444
MARLOWE 47.3955555558
BURNS 497.395555556
MITTY 247.395555556
JOYCE 202.604444444
#
The following example displays the same information as the preceding example, except
that the difference between each employee’s salary and the average is rounded to three
decimal places:
EMP-LNAME SCALE
---------- ------------------
FIELDS 2.604
HARDWICK 802.604
JONSON 475.836
DEKKER 297.396
CHAPMAN 557.604
MARLOWE 47.396
BURNS 497.396
MITTY 247.396
JOYCE 202.604
#
Virtual Items
Inquiry may be used to compute or display a value that is not physically present in the
database. Such an item, known as a virtual item, is created using the VIRTUAL
command. (Refer to “VIRTUAL Command” in Section 3.)
Any form of arithmetic expression is allowed to the right of the equal sign (=) in the
VIRTUAL command. The rule is that the items specified in a VIRTUAL command must
yield a result when the virtual item is referenced.
System efficiency is improved when arithmetic functions are associated with virtual
identifiers. If an arithmetic function appears in a display list or selection condition, the
system must evaluate the function each time the function is referenced. By contrast, if
an arithmetic function is associated with a virtual identifier, the system remembers
whether the function has been evaluated and, if so, also remembers the value of the
function.
The system recognizes when the value of an arithmetic function associated with a virtual
identifier becomes meaningless and reevaluates this value, if necessary.
A virtual cannot be cleared until all virtuals (if any) that reference that virtual have been
cleared. The only exception to this rule is during use of the CLEAR VIRTUALS command
which clears all virtuals. Thus, if VIRTUAL A = 10 and VIRTUAL B = A + 5, virtual A
cannot be cleared until virtual B is cleared or the CLEAR VIRTUALS command is used.
Examples
In the following example, a virtual item, SKILLINDEX, is created based on the typing
speed and shorthand speed of the employees in the database:
The virtual item SKILLINDEX is then displayed for the specified job type:
JOB-TITLE SKILLINDEX
------------------------------ ------------------
RECEPTIONIST 1
SECRETARY 1.7
EXEC SECRETARY 0.6
#
In the following example, a virtual item, OUR-GPA, is created based on the grade-point
average of employees in the database:
The virtual item OUR-GPA is then displayed for the specified employee in EMP along
with the university that the employee attended and the employee’s major field of study:
Undefined Items
References can be made in selection conditions, display lists, or arithmetic expressions
that cause the values of items to be undefined. Item values are undefined in the
following situations:
If an item with an undefined value is displayed, two hyphens are displayed instead of the
value of the item.
Example
In the following example, the item TYPE-SPEED is undefined for the specified JOB-
TYPE:
The SET command is used to associate a specified Inquiry command with a particular
structure. The specified command is not executed immediately, but Inquiry is able to
remember it. The REPEAT command is used to execute a command that has been
remembered in this way. (Refer to “SET Command” and “REPEAT Command” in
Section 3 for descriptions of this process.)
Examples
In the following example, the item EMP-NO in the EMP data set and the corresponding
item ADR-EMP-NO in the ADR data set are set equal to each other. In this way, the
name, social security number, address, and zipcode of each employee with an address in
the database can be displayed.
#%
#
-> DISPLAY EMP-NAME, EMP-NO VIA EMP AT EMP-NO < 4 THEN REPEAT ADR
ADR-STREET-NO ADR-ZIP
------------------------------ -------
5 MAIN ST NEWTOWN PA 56662
ADR-STREET-NO ADR-ZIP
------------------------------ -------
45 ALEXANDER RD DU BOIS PA 50007
ADR-STREET-NO ADR-ZIP
------------------------------ -------
678 ARCADIA BLVD ROSSITER PA 57667
#
Database Modification
The Inquiry UPDATE, CREATE, and DELETE commands may be used to modify the
contents of a database.
Update
The UPDATE command changes the values of items in the currently selected record.
Several items, together with their new values, may be specified in a single UPDATE
command; however, all specified items must belong to the same record.
When changing the number of occurrences of an occurring item that has OCCURS
DEPENDING ON specified in DASDL, the user must ensure that the “depending on”
item is properly updated. Failure to maintain the value for the “depending on” item can
result in the loss of new values for occurring items.
Because Inquiry remembers the list of updated items for each data set, the user need
not reenter the same UPDATE command if the same change is to be made to several
records in the data set. Instead, the UPDATE command may specify the data set name;
Inquiry then performs the change indicated by the most recently entered UPDATE
command for that data set.
If the user forgets the contents of the current update list or wishes to edit the current
update list, the RECALL command may be executed to display the current update list for
any structure. (Refer to “RECALL Command” in Section 3.)
Inquiry may be generated without the UPDATE feature in order to prevent unauthorized
database modification. (Refer to “Inquiry Generation” in Appendix A.)
Examples
In the following example, the record for the first employee in the data set EMP with
security clearance is selected and displayed:
The UPDATE command is then used to change the employee’s security clearance to
FALSE and the employee’s salary to 2000:
The record for the next employee in EMP with security clearance is then selected and
displayed:
-> NEXT
The UPDATE command is then used to change the employee’s last name from
HARDWICK to KRANTZ:
The CREATE command can add a record to an embedded structure; however, such a
record can be created only if a record is currently selected for the master structure.
Any items omitted from a CREATE command are assigned the initial values specified by
DASDL. If any required items are left null, the newly created record cannot be stored,
and an error message is displayed.
Records may be deleted from a database using the DELETE command (refer to
“DELETE Command” in Section 3). A DELETE command must specify the data set from
which the record is to be deleted.
The normal Enterprise Database Server rules for performing record deletion also apply to
Inquiry record deletion. That is, before a record that contains embedded data sets can be
deleted, all of its embedded records must first be deleted.
Inquiry may be generated without the CREATE and DELETE commands in order to
prevent unauthorized database modification. (Refer to “Inquiry Generation” in
Appendix A.)
Examples
In the following example, a new record is created for the data set ADR and then
displayed:
#NONE
#
In the following example, a record of the data set ADR is selected and then deleted:
#NONE
The following example illustrates the deletion of a record from an embedded data set.
First, a record of the data set EMP is selected, and the corresponding record in the
embedded set ED-DATE-SET is displayed.
Next, a record in the embedded data set EMP-ED is selected using the embedded set
ED-DATE-SET:
#NONE
#
• Other programs that may be using the database simultaneously with Inquiry are not
suspended while Inquiry waits for a response from a terminal.
• Inquiry transactions are not backed out when a Halt/Load occurs or a simultaneous
user program aborts.
If an error occurs on an Inquiry transaction, the error is reported and the database is not
modified.
DISPLAY Command
If a selection expression is included in a DISPLAY command, the DISPLAY command can
display information for as many records satisfying the selection condition as can fit on
the output device. This form of the DISPLAY command allows the user to control the
amount of output displayed at one time by including a limit in the DISPLAY command.
(Refer to Option 2 under “DISPLAY Command” in Section 3.) If the user then enters
NEXT or a blank, Inquiry responds by selecting the next record and displaying records
according to the previously entered specifications. This procedure may be repeated until
all records that satisfy the selection condition have been displayed.
If output is displayed on a terminal, Inquiry automatically sets the limit for displayed
output to the screen size of the terminal.
Example
The following DISPLAY command specifies that records meeting the selection condition
are to be displayed two at a time:
ADR-STREET-NO ADR-ZIP
------------------------------ -------
45 ALEXANDER RD DU BOIS PA 50007
678 ARCADIA BLVD ROSSITER PA 57667
#
-> NEXT
ADR-STREET-NO ADR-ZIP
------------------------------ -------
2345 HUNTINGTON ST READING PA 50007
6 OLIVE AVE BELVEDERE NJ 56432
-> NEXT
ADR-STREET-NO ADR-ZIP
------------------------------ -------
23 PHILIPS ST APT 2 MARLENA GA 42323
#NO MORE
#
Embedded Structures
In a DISPLAY command involving embedded structures, the amount of uninterrupted
output can be controlled on a structure basis. Output limit numbers also can be used to
selectively bypass some of the output.
In certain instances, stopping on a limit for one structure coincides with stopping on a
limit for another structure. In these cases, the user may have to enter NEXT twice to
resume output.
Examples
In the following example, the first record in the data set EMP is selected. The colleges
(contained in the embedded data set EMP-ED) attended by that employee where the
employee attained a grade-point average greater than 3.5 are then displayed, one at a
time.
-> SELECT EMP THEN DISPLAY 1 ED-INST-NAME WHERE ED-GPA > 3.5
ED-INST-NAME
------------------------------
CARLETON
#
-> NEXT
ED-INST-NAME
------------------------------
UCLA
#
-> NEXT
The second of the preceding NEXT commands was requesting the next ED-INST-NAME
for this same employee. However, at this point no more embedded items satisfy the
selection condition for this EMP. Because the implicit limit for the SELECT command is
1, the NEXT command must be entered again to select the next record from EMP and
display the desired information for that record.
-> NEXT
ED-INST-NAME
------------------------------
UNIV OF SO CAL
#
In the following example, a record is selected from EMP, and a college where the
employee’s major was not Philosophy is displayed:
ED-INST-NAME
------------------------------
UNIV OF MARYLAND
#
Then, the next record from EMP is selected and the same information is displayed for
the employee corresponding to the newly selected record:
ED-INST-NAME
------------------------------
UNIV OF SO CAL
#
If NEXT alone had been entered in the preceding example, the next ED-INST-NAME
record would have been displayed for the same employee.
Finally, the schools attended by the newly selected employee where the employee’s
major was not Social Science are displayed two at a time:
ED-INST-NAME
------------------------------
UNIV OF SO CAL
UCLA
#
-> NEXT
#NO MORE
#
Formatting Attributes
The format of the data displayed on the terminal or printer is controlled by the format
attributes HEADING, TAB, and SINGLE. The following discussion pertains to output
formatting on a terminal; the same formats are displayed with output to a printer. (Refer
to “TERMINAL Command” and “PRINTER Command” in Section 3.)
Heading
The HEADING attribute causes output to be displayed in the following format:
N1 N2 N3
-- -- --
V11 V12 V13
V21 V22 V23
In the preceding format diagram, N1, N2, and N3 are the item names; V11, V12, and V13
are the values associated with those items in record 1; and V21, V22, and V23 are the
values of those items in record 2.
T F H
In some cases the display list is so large that all item names, or all item values, or both
cannot fit on a single line. In these cases, the displayed output has the following format:
1:N1 N2 N3 <---|
|-- Item names
2:N4 N5 N6 <---|
Association between each item name and the corresponding item value is made by line
number and position within the line. For example, item N1 has a value of V11 in the first
record and a value of V21 in the second record; item N5 has a value of V15 in the first
record and a value of V25 in the second record.
If output is displayed at a terminal and the number of title lines and value lines for a
single record exceeds the screen limit, Inquiry sets the TAB formatting attribute and
displays output in TAB format from that point onward. Otherwise, all displayed output
appears in HEADING format by default.
Example
In the following example, items from the data set JOB are displayed, three at a time, in
HEADING format:
-> T F H
-> D 3 JOB
1:JOB-COUNT JOB-TYPE JOB-CODE JOB-TITLE
2:TYPE-SPEED SHORTHAND-SPEED CRTUSE-REQD SPANISH-REQD
3:DRIVING-REQD JOB-COMMENT
-------------------------------------------------------------------
1: 1 0 9999 VICE PRESIDENT
2: -- -- -- --
3:-- --
1: 1 0 4000 ACCOUNTANT
2: -- -- -- --
3:-- --
1: 1 0 8888 CONTROLLER
2: -- -- -- --
3:-- --
#
Tab
The TAB attribute causes displayed output to appear in the following format:
In the format diagram above, N1 through N5 represent the item names, and V11 through
V15 represent the values associated with the item names.
T F T
Each name=value combination begins at a new tab position, where the tab stops are at
every fifth position starting with character position 3.
Example
In the following example, items from the data set JOB are displayed, three at a time, in
TAB format:
-> T F T
-> D 3 JOB
Single
The SINGLE attribute causes displayed output to appear in the following format:
N1 = V11
N2 = V12
N3 = V13
N1 = V21
N2 = V22
N3 = V23
In this formatting diagram, N1 through N3 represent the item names, and V11 through
V23 represent the associated values. SINGLE causes one item name and its associated
value to be displayed on each line starting at character position 3. If more than one
record is displayed, a blank line separates the displayed records.
T F S
Example
In the following example, items from the JOB data set are displayed, three at a time, in
SINGLE format:
-> T F S
-> D 3 JOB
JOB-COUNT = 1
JOB-TYPE = 0
JOB-CODE = 9999
JOB-TITLE = VICE PRESIDENT
TYPE-SPEED = --
SHORTHAND-SPEED = --
CRTUSE-REQD = --
SPANISH-REQD = --
DRIVING-REQD = --
JOB-COMMENT = --
JOB-COUNT = 1
JOB-TYPE = 0
JOB-CODE = 4000
JOB-TITLE = ACCOUNTANT
TYPE-SPEED = --
SHORTHAND-SPEED = --
CRTUSE-REQD = --
SPANISH-REQD = --
DRIVING-REQD = --
JOB-COMMENT = --
JOB-COUNT = 1
JOB-TYPE = 0
JOB-CODE = 8888
JOB-TITLE = CONTROLLER
TYPE-SPEED = --
SHORTHAND-SPEED = --
CRTUSE-REQD = --
SPANISH-REQD = --
DRIVING-REQD = --
JOB-COMMENT = --
Inquiry Report
The Inquiry Report feature produces simple reports from information contained in
Enterprise Database Server databases.
A number of Inquiry commands are used to specify a report. (Refer to Section 3 for
detailed discussions of these commands.)
The REPORT command specifies items and values to be printed on the report, names
and positions of columns on the report, and criteria for control breaks and page control.
Selection conditions for records input to the report process may be specified using either
the SELECT command or the SET command. Normally, the SET command should be
used in order to avoid redundant calls on Enterprise Database Server functions.
The optional SUMMARY command can be used to cause the report process to gather
statistical information, such as column averages, totals, and counts, for items in the
report list. The SUMMARY command, if used, must follow the REPORT command.
The optional TITLE command can be used to specify an initial report title page, a heading
for the top of each report page, or both. The length of a report-title line cannot exceed
the line width of the output device. The column position number indicated in the report
specifications added to the column heading size must not exceed the device line size.
For reports directed to line printers, the line width is equal to the printer width. For
reports directed to hardcopy terminals, the line width is equal to the terminal width. For
reports directed to screen terminals, the line width is equal to the terminal width minus
one column. In addition, the last 10 columns of the first line of a report title are reserved
for the page number. Thus, the length of the first line of a title cannot exceed the column
width minus 21.
If more than one report is to be generated during a session, a CLEAR REPORT command
should be entered before entering any command for the next report.
The GENERATE command initiates the actual report-generation process. The report can
be sent to either the user’s terminal or the site printer by specifying TERMINAL or
PRINTER, respectively, in the OPTIONS command. If the report is intended for the site
printer, OPTIONS PRINTER should be entered before the GENERATE command is
entered, as the formatting of the report is based on the attributes specified in the
PRINTER and TERMINAL commands.
When the report is output to a hardcopy terminal and a new page is required, then
sufficient blank lines are written to ensure a full page. (The report-generation procedure
automatically writes four blank lines at the end of an output page. These lines should be
taken into account if the terminal PAGE attribute is set; refer to “TERMINAL Command”
in Section 3.) Then, if the terminal SCREEN attribute is TRUE, the system stops until a
blank character is input. If SCREEN is FALSE, then four more blank lines are printed
before the next page is started.
The RECALL command can be used to display any previously entered REPORT,
SUMMARY, or TITLE command. The recalled command can then be modified using the
EDIT and REPEAT commands. If a REPORT command is modified in this way, then any
SUMMARY command associated with the report that contains items that were added or
deleted from the original REPORT command should be modified, as well. Inquiry
displays the following message if REPORT command specifications have been modified
without modifying an associated SUMMARY command:
The various statements used to generate a report should be entered using a multiple-
command DEFINE. In this way, report definitions can be saved between Inquiry
sessions.
Examples
In the following example, a report is generated listing employees in the data set EMP
that were hired before 1962. First, a selection condition for these employees is entered:
Next, the REPORT command is used to specify the items (each employee’s last name,
hiring date, employee number, and salary) to appear in the report:
A TITLE command is entered to specify a heading for each page of the report:
#STARTING REPORT
# REPORT COMPLETED
#
In the following example, the original report specifications are recalled and edited. A
REPEAT command is entered to replace the original specifications with the edited
specifications, and a new report is generated.
REPORT EMP-LNAME,EMP-DATE-HIRED,EMP-NO,EMP-SALARY
#
REPORT EMP-LNAME,EMP-FNAME,EMP-NO,EMP-SALARY
#
-> REPEAT
# STARTING REPORT
20 YEAR EMPLOYEES PAGE 1
EMP-LNAME EMP-FNAME EMP-NO EMP-SALARY
---------- ---------- ------ ----------
MARLOWE PHILLIP 6 2200.00
MITTY WALTER 8 2000.00
# REPORT COMPLETED
#
In the following example, the SUMMARY command is used to specify that the number
of employees in the report is printed at the end of the report:
# STARTING REPORT
20 YEAR EMPLOYEES PAGE 1
EMP-LNAME EMP-FNAME EMP-NO EMP-SALARY
---------- ---------- ------ ----------
MARLOWE PHILLIP 6 2200.00
MITTY WALTER 8 2000.00
.
.
.
20 YEAR EMPLOYEES PAGE 2
SUMMARY FOR REPORT
EMP-LNAME :COUNT=2
# REPORT COMPLETED
#
In the following example, the REPORT command specifies the beginning column and
column length for the items specified as column headings in a new report. Inquiry
displays a warning message because no modification has been made to the associated
SUMMARY command.
-> REPORT EMP-LNAME AT 2 FOR 20, EMP-FNAME AT 30 FOR 10, EMP-NO AT 45%
%#
-> FOR 10, EMP-SALARY AT 60 FOR 10
# STARTING REPORT
20 YEAR EMPLOYEES PAGE 1
EMP-LNAME EMP-FNAME EMP-NO EMP-SALARY
-------------------- ---------- ---------- ----------
MARLOWE PHILLIP 6 2200.00
MITTY WALTER 8 2000.00
.
.
.
20 YEAR EMPLOYEES PAGE 2
SUMMARY FOR REPORT
EMP-LNAME :COUNT=2
# REPORT COMPLETED
#
Inquiry Extract
The Inquiry Extract feature allows items in selected records to be extracted to a standard
data file.
A number of commands are used to specify an extract file. (Refer to Section 3 for
detailed descriptions of these commands.)
The EXTRACT command specifies the items to be extracted, allows changes to be made
to the size and format of items, and positions items in the extracted record. A record
layout is produced indicating the item name, item type and size, and item offset (in
digits) in the record.
As in the Inquiry Report feature, the SET or SELECT command specifies selection
conditions for records to appear in the extract file, and the extract process is initiated
using a GENERATE command. A single GENERATE command may be used to generate
both an extract file and a report. Because items for the extract file and items for the
report are specified in different commands, different items may be extracted and
reported using the same GENERATE command.
The optional FILE command may be used to set commonly used file attributes for the
extract file. If the INTNAME attribute is set using this command, Work Flow Language
(WFL) file-equation attributes may be attached to the extract file.
Examples
The following EXTRACT command creates an extract file based on items from the data
set EMP according to the following specifications:
• The items EMP-LNAME, EMP-SSN, and EMP-SALARY, plus the result of the
arithmetic expression EMP-SALARY * 12, are extracted. EMP-LNAME is, by default,
extracted in ALPHA format. The arithmetic expression result is, by default, extracted
in REAL format. EMP-SSN and EMP-SALARY are, according to the specification in
the Extract command, extracted in NUMBER format.
• EMP-SSN is extracted with a precision of 9. EMP-SALARY is extracted with a
precision of 5 and a scale factor of 4.
• In the event of a null error for EMP-SALARY, the value for EMP-SALARY in the
extract file is all bits ON. In the event of a fault error for the arithmetic expression
EMP-SALARY * 12, the resulting value is all bits ON, and a warning message is
generated.
-> Extract EMP-LNAME, EMP-SSN N (9), EMP-SALARY N (5,4) [NULL=HIGH],%
#%
-> EMP-SALARY * 12 [FAULT=HIGH WARN]
The following GENERATE command is then executed to create the extract file:
# STARTING Extract
# Extract COMPLETED
#
Introduction
This section describes the syntax and semantics of each Inquiry input command. All
Inquiry commands except SELECT and DISPLAY are discussed alphabetically in this
section. Because of their close relationship and their importance to the Inquiry program,
the SELECT and DISPLAY commands are discussed together at the beginning of the
section, immediately following the description of common syntactic items.
Command Description
ATTACH Combines statements for an embedded data set with statements for its
master data set to establish automatic looping between the two
structures.
CLEAR Discards define items, virtual items, and generated subsets.
CREATE Creates a new record to be added to a data set.
DEFINE Assigns a name to a combination of one or more Inquiry constructs (for
example, identifiers, display lists, selection conditions, or commands).
DELETE Removes the currently selected record from a data set.
DETACH Separates an embedded data set from its master data set to prevent
automatic looping between the two structures.
DISPLAY Displays items of a selected record or the value of an arithmetic
expression involving numeric constants.
EDIT Modifies contents of Inquiry commands in the current buffer.
EXTRACT Specifies items to be included in an extract file and controls the format of
these items in the report.
FILE Displays or sets commonly used attributes for extract files.
GENERATE Creates a report, an extract file, or a temporary subset of a data set.
HELP Displays syntax or semantics for Inquiry commands or diagnostic
information related to the last error encountered.
Command Description
NEXT Causes Inquiry to resume record selection and item display from the most
recent stopping point.
OPTIONS Controls destination and contents of output from DISPLAY commands.
PRINTER Displays or alters printer-file attributes assigned by Inquiry.
QUIT Terminates the Inquiry session.
RECALL Loads the current buffer with a previous Inquiry command and displays
this command on the terminal.
REDEFINE Changes the text associated with a define or virtual.
REPEAT Executes the command in the current buffer.
REPORT Specifies items to be listed in a report and controls the format of the
report.
RESTORE Reloads previously saved declarations.
SAVE Stores the text of define items, virtual items, and generated subsets in a
file on disk for later use.
SELECT Locates records that satisfy selection conditions.
SET Establishes the text of a DISPLAY, REPEAT, SELECT, CREATE, SORT, or
UPDATE command, a SORT option, or a limit option for a given data set.
Can also be used to modify or delete the text of the most recently entered
such construct for a given data set.
SHOW Displays specified parts of a database description, contents of the current
buffer, define items, virtual items, or generated subset specifications.
SORT Displays or modifies core and disk parameters used by the SORT option.
SUMMARY Provides statistical information about items contained in a report list.
TERMINAL Displays or alters terminal file attributes.
TITLE Defines the title characteristics of a report.
UPDATE Modifies items in a selected record and stores updated record in the data
set.
VIRTUAL Creates virtual items (items that are functions of other items).
Selection Condition
A selection condition specifies conditions that a record must satisfy if that record is to be
selected.
Parentheses and the logical operators AND, OR, and NOT can be used in conjunction
with simple selection conditions to form complex selection conditions. The following
order of precedence controls the sequence in which selection conditions are evaluated:
1. Arithmetic expressions
2. Relational operators
3. NOT
4. AND
5. OR
When operators have the same precedence, the operations are performed in order from
left to right. Parentheses are used to override the usual order of evaluation.
Selection conditions may also contain relationships involving alpha items, alpha literals,
and relational operators. Care must be taken that alpha literals beginning with letters are
not mistaken for identifiers; by default, Inquiry interprets such alpha literals as identifiers
if any confusion arises.
Items in a selection condition may be tested to determine if they have NULL values.
Only items that may take NULL values may be tested. If an attempt is made to test an
item that cannot take a NULL value, the following error message is displayed:
ERR: NULL
#TEST FOR NULL IS SUPERFLUOUS--ITEM CAN NOT BE NULL.
#
If a data item is undefined because the item is in a variable format that does not appear
in a particular record, or because its subscript is undefined, both tests against NULL
(EQL and NEQ) evaluate to FALSE.
Syntax
<selection condition>
OR
AND
<Boolean item>)
NOT *<Boolean primary>)
( <selection condition> )
<Boolean primary>
<Boolean function>)
* <alpha item 1> <rel op> <alpha item 2>)
<alpha literal>)
*<arithmetic function> <rel op> <arithmetic expression> )
*<arithmetic item>)
*<virtual item>
*<alpha item> EQL NULL
<arithmetic item> * NEQ )
* = )
^=
<alpha literal>
<quoted alpha literal>)
<unquoted alpha literal>
<arithmetic expression>
<arithmetic operator>
<arithmetic primary>)
( <arithmetic expression> )
<arithmetic primary>
<arithmetic function>)
*<arithmetic item>)
*<numeric constant>)
<virtual item>
<numeric constant>
<integer>)
* + ) . )
<integer>)
. <integer>
Explanation
The following table explains the elements of the selection condition syntax diagrams.
Element Description
AND Boolean operators used to form complex selection
OR conditions.
NOT
<Boolean item> Item of type BOOLEAN in the selected record.
<Boolean primary> Yields a value of TRUE or FALSE on evaluation.
<Boolean function> Defined under “Boolean Function” later in this section. Must
reference an item in an embedded structure within the
record being selected.
<alpha item> Items of type ALPHA. <alpha item 1> must be in the data
<alpha item 1> set to be selected unless it is used in a Boolean function.
<alpha item 2> <alpha item 2> cannot be in a data set embedded in the data
set to be selected. If <alpha item 2> is not in the data set to
be selected, then the data set containing <alpha item 2>
must have a current record.
<alpha literal> May be quoted or unquoted, depending on the command
context and the value of OPTIONS QUOTES. (Refer to
“OPTIONS Command” in this section.)
<quoted alpha literal> A quoted sequence of characters containing uppercase
characters A–Z, lowercase characters a–z, numeric
characters 0–9, special characters, and blanks.
To include a double quotation mark as part of a string literal,
you must surround the double quotation mark with double
quotation marks. You use three double quotation marks,
such as “””. The following example returns AB”C:
AB”””C
<unquoted alpha A sequence of characters containing only uppercase
literal> characters A–Z, lowercase characters a–z, and numeric
characters 0–9. Special characters and embedded blanks are
not allowed in an <unquoted alpha literal>.
<rel op> Indicates that a relational operator is to be used. Relational
operators are defined in the following table.
Symbolic
Operator Operator Definition
EQL = Equal to
NEQ ^= Not equal to
LSS < Less than
LEQ <=, ^> Less than or equal to
Element Description
GTR > Greater than
GEQ >=, ^< Greater than or equal to
Operator Definition
+ Add.
– Subtract (at least one blank must
separate this operator from it
operands, that is, "A – B" is
interpreted as A minus B. "A–B" is
interpreted as data item "A–B".
* Multiply.
/ Divide.
DIV Integer divide (yields an integer
result and discards remainder).
MOD Remainder divide (yields the
remainder after an integer divide).
Examples
The following selection condition specifies records in the data set EMP for which the
Boolean item EMP-SEC-CLEAR is FALSE:
NOT EMP-SEC-CLEAR
The following selection condition specifies records in the data set EMP for which the
item EMP-SALARY is greater than the average value of EMP-SALARY for all records in
EMP:
The following selection condition specifies embedded EMP-ED records for which the
virtual item OUR-GPA (refer to “Virtual Items” in Section 2) is greater than 7.5:
The following selection condition specifies records in the master data set EMP for which
all embedded EMP-ED records have a value other than UNIV CAL DAVIS for the item
ED-INST-NAME:
Display List
A display list specifies the data items or values to be displayed.
Qualifiers may be used to create unique names for data items that have the same name
in different structures in the database. Multiple levels of qualification may be used, if
necessary.
If no subscripts are specified for an item, all occurrences of the specified item are
displayed.
Particular data items need not be included in a display list. If desired, the result of an
arithmetic expression or arithmetic current record function involving only numeric
constants may be displayed. In this case, Inquiry is said to be in calculator mode.
Syntax
<display list>
,
<arithmetic expression>)
*<arithmetic function>)
*<data item>)
*<virtual item>)
<occurrence segment>
<data item>
<data item name>G
OF <qualifier>
G)
,
( <subscript> )
<occurrence segment>
<data item name>G
OF <qualifier>
G)
,
( <subscript 1> TO <subscript 2> )
<qualifier>
<data set>)
Explanation
The following table explains the elements of the display list syntax diagrams.
Element Description
<arithmetic expression> Defined under “Selection Condition” in “Common
Syntactic Items.”
Element Description
<arithmetic function> Defined under “Common Syntactic Items.”
<virtual item> Item established by the VIRTUAL command.
<data item> Item to be displayed. This specification may require
qualification or specification of a subscript to ensure
uniqueness.
<occurrence segment> Range of occurring elements that are displayed. All
elements of the occurring item between <subscript
1> and <subscript 2>, inclusive, are displayed.
<data item name> Name of a data item to be displayed. May be the
name of a subscripted item or the name of an item
present in more than one data set.
OF <qualifier> Specifies the data set from which to display the data
item, if data items in more than one data set have the
same name.
<subscript> Integer constant between 1 and the DASDL-declared
<subscript 1> limit for an item declared with an OCCURS clause in
<subscript 2> DASDL.
Examples
The display list in the following DISPLAY command specifies that the result of the given
arithmetic expression is to be displayed:
The display list in the following DISPLAY command specifies that the following data
items are to be displayed:
• The result of the arithmetic function STD (standard deviation) over the item TYPE-
SPEED for all appropriate selected records.
• The items JOB-CODE and JOB-TITLE for the selected record or records.
• The virtual item SKILLINDEX for the selected record or records.
Sort Option
The sort option specifies the sequence in which records are accessed. A sort option
specification can follow a selection condition in a SELECT or DISPLAY command and can
be established, modified, or eliminated using the EDIT or SET commands.
No more than 25 key items may be specified in a sort option. All key items that have
been defined in the DASDL with an OCCURS clause must be subscripted using integer
constants.
The sort option uses the system SORT intrinsic. During record selection, each record of
the specified data set that satisfies the selection condition is read from the database. An
entry consisting of the extracted key items and the database address of the record is
made in a tag file; the tag file is then passed to the system SORT intrinsic, which sorts
the tag entries in the sequence specified by the key item.
Inquiry reads the sorted tag file sequentially. For each tag entry, Inquiry reads the data
set record at the address indicated in the tag entry. Inquiry then performs the same as if
the data set record had been obtained directly from the data set. (For example, Inquiry
displays items or executes the command associated with any attached embedded data
set.)
By default, the SORT intrinsic is allocated 12,000 words of core and 600,000 segments
of disk. The SORT command can be used to alter these statements. (Refer to “SORT
Command” in this section.)
Syntax
<sort option>
SORT <sort specification>)
<sort specification>
/24\ ,
<key item>)
ON * ASCENDING )
DESCENDING
<key item>
<alpha item>)
<numeric item>
Explanation
The following table explains the elements of the sort option syntax diagrams.
Element Decription
<sort specification> Specifies key item on which to sort and the
order of the sort.
ON May be included to improve readability.
<key item> Data item of the selected data set.
ASCENDING Specifies order of the sort.
DESCENDING
<alpha item> Item of type ALPHA.
<numeric item> Item of type COUNT, FIELD, NUMBER,
POPULATION, REAL, or RECORDTYPE.
Examples
In the following example, the records in the data set EMP are sorted in ascending order
of each employee’s date of hiring (least recently hired to most recently hired):
In the following example, the records in EMP are sorted in descending order of each
employee’s date of hiring (most recently hired to least recently hired):
Functions
Inquiry supports the use of Boolean functions and arithmetic functions. These functions
are described in the following paragraphs.
Boolean Function
A Boolean function may be used to specify a selection condition involving an embedded
structure.
Syntax
ANY ( <selection condition> ) )
ALL <structure> AT )
* IN )
WHERE
Explanation
The following table explains the elements of the Boolean function syntax diagram.
Element Description
ANY Yields the value TRUE if any record in the
embedded data set satisfies the selection
condition.
ALL Yields the value TRUE if all records in the
embedded data set satisfy the selection
condition.
<structure> An embedded structure in the selected
record.
AT Must separate the embedded structure
IN specification and the selection condition.
WHERE
<selection condition> Defined under “Common Syntactic Items.”
Examples
In the following example, the Boolean function returns a value of TRUE for records in
ED-DATE-SET for which all occurrences of the item ED-GPA are greater than 2.0:
In the following example, the Boolean function returns a value of TRUE for records in
ED-DATE-SET for which any occurrence of the item ED-GPA is greater than 2.0:
Arithmetic Function
An arithmetic function may be used to specify the result of an arithmetic operation on
embedded or disjoint structures, numeric constants, or both. Arithmetic functions are of
two types: data set functions and current record functions. These types are discussed in
the following paragraphs.
Syntax
<data set function>)
<current record function>
Data set functions are functions of a sequence of values and may refer to several
records. A number of records may be read and selected during the evaluation of these
functions.
By default, all records in the specified structures are used in the computation. If a data
set function includes a selection condition, only records that satisfy the selection
condition are used in evaluating the function.
If a selection condition within a data set function contains a relational operator, data
items to the right of the relational operator may be in the record to be selected or in any
record previously selected at a higher embedding level. (Relational operators are defined
under “Selection Condition” in “Common Syntactic Items.”)
If a structure is designated in a data set function, only records retrieved through that
structure are evaluated.
Syntax
COUNT ( <count options> ) )
* SUM ( <arithmetic expression> <selection options> )
* AVG )
* MAX )
* MIN )
* SSQ )
* MSQ )
* VAR )
STD
<selection options>
)
* VIA <structure> * AT <selection condition>
USING * IN )
WHERE
<count options>
<selection condition>)
<structure>)
* AT <selection condition>
* IN )
WHERE
Explanation
The following table explains the elements of the data set functions syntax diagrams.
Element Description
COUNT Returns the number of records that satisfy the
selection condition or the number of records in the
structure.
<count options> Establishes selection conditions or designates
structures for records input to the COUNT function.
<arithmetic expression> Defined under “Selection Condition” in “Common
Syntactic Items.”
<selection options> Establishes selection conditions or designates
structures for records input to data set functions
except COUNT.
VIA Designates the structure to be used to access
USING records.
<structure> The structure used to access records.
AT Introduces a selection condition for records to be
IN used.
WHERE
<selection condition> Defined under “Common Syntactic Items.”
SUM Sum of the values of all items in the sequence.
AVG Sum of the specified items in the sequence divided
by the number of values summed.
MAX Maximum value of the arithmetic item in the
sequence.
MIN Minimum value of the arithmetic item in the
sequence.
SSQ Sum of the squares of the specified items in the
sequence.
MSQ Mean square; sum of the squares of the specified
items in the sequence divided by the number of
items.
VAR Variance; defined to be (SSQ-N*AVG**2)/(N-1), where
N is the number of records selected.
STD Standard deviation; square root of the variance.
A current record function is a function of a single value and must refer to a constant or
an item in a currently selected record. No records are selected to evaluate a current
record function.
Syntax
SCALE ( <arithmetic expression>,<arithmetic expression> ) )
* ABS ( <arithmetic expression> )
* SIN )
* COS )
* TAN )
* ARCSIN )
* ARCCOS )
* ARCTAN )
* EXP )
* LN )
* LOG )
SQRT
Explanation
The following table describes the syntax elements of the current record function. In the
following descriptions, X and F are arithmetic expressions. (Arithmetic expressions are
defined under “Selection Condition” in “Common Syntactic Items.”)
Element Description
SCALE(X,F) Returns the value of X rounded to F fractional digits.
Non-fractional digits are unaffected.
ABS(X) Absolute value of X.
SIN(X) Sine of the angle X, where value of X is in radians.
COS(X) Cosine of the angle X, where value of X is in radians.
TAN(X) Tangent of the angle X, where value of X is in radians.
ARCSIN(X) Inverse sine of X, where ABS(X) <= 1.
ARCCOS(X) Inverse cosine of X, where ABS(X) <= 1.
ARCTAN(X) Inverse tangent of X.
EXP(X) Exponential function (“e” raised to the X power, where
e = 2.718.).
LN(X) Natural logarithm of X (base = e), where value of X > 0.
LOG(X) Logarithm of X to base 10, where value of X > 0.
SQRT(X) Square root of X, where value of X >= 0.
Examples
The following arithmetic function returns the number of records in the data set JOB for
which the item TYPE-SPEED is greater than 60:
The following arithmetic function returns the number of records in the subset EMP-
OVER10-SUBSET:
COUNT(EMP-OVER10-SUBSET)
The following arithmetic function returns the absolute value of the mean square of the
values of EMP-SALARY in the subset EMP-OVER10-SUBSET:
SELECT Command
The SELECT command locates a record that satisfies the selection specification
contained in the command. If Inquiry locates a record that satisfies this specification, it
displays a number sign (#). If Inquiry fails to locate such a record, it displays the message
#NONE.
The user is not required to specify the name of the data set to be selected. Inquiry can
determine the data set from which to select records by examining the items specified in
the SELECT command. If a structure is not specified, Inquiry uses sets when selecting
records, if possible. If an appropriate set does not exist, Inquiry searches the data set
directly.
Subsets, link items, and temporary subsets may not locate all records of the data set
that satisfy the selection specification. Thus, Inquiry does not automatically use these
structures, and they must be specified in the SELECT command if Inquiry is to use them
to locate records.
When items are selected using a link item or an embedded manual subset that refers to
one of its own ancestors, the user may specify that only the data portion of the selected
record is to be retrieved. In this case, the original sequence of records is retrieved. (By
default, each link begins a new sequence.)
The SELECT command may contain a REPEAT option, which causes Inquiry to execute
commands associated with the specified data set and its attached embedded structures.
The REPEAT option is executed only if the selection specifications preceding the option
are satisfied.
Syntax
SELECT <select specification>)
<repeat option>
<select specification>
<selection condition>)
* AT ) , <sort option>
* IN )
* WHERE
*<structure option>
* VIA )
USING
<structure option>
<structure>)
DATA * AT <selection condition>
* IN )
WHERE
<repeat option>
THEN REPEAT <data set>)
, )
THEN
Explanation
The following table explains the elements of the SELECT command syntax diagrams.
Element Description
<select specification> Establishes selection conditions or designates
structures to use in record selection and specifies
any sorting of selected records.
<repeat option> Causes Inquiry to execute commands associated
with the data set. All select specifications must be
satisfied before this option is executed.
<selection condition> Defined under “Common Syntactic Items.”
AT Precedes specification of a selection condition.
IN
WHERE
<sort option> Defined under “Common Syntactic Items.”
VIA Precedes structure designation.
USING
<structure option> Specifies the structure to be used to access
records.
<structure> Data set, set, subset, link item, or a temporary subset
created by the GENERATE command.
Element Description
DATA Retrieves only the data portion of the selected link
item or embedded manual subset.
THEN Precedes REPEAT in the repeat option.
,
,THEN
REPEAT <data set> Executes most recent SELECT or DISPLAY command
associated with the data set.
Examples
The following SELECT command selects records from data set JOB for which JOB-TYPE
is 2 and JOB-TITLE is not VICE PRESIDENT. (Inquiry is able to determine from the items
specified which data set to use for selecting records.)
The following SELECT command selects the same records as the commands in the
preceding example, but selects them in alphabetical order of job titles:
DISPLAY Command
The DISPLAY command displays data item names and their associated values or the
results of arithmetic expressions and arithmetic current record functions. By default, all
displayed output uses HEADING format unless a record displayed on a terminal screen is
so large that its heading and values cannot fit on the screen. In this case, the output is
displayed in TAB format. (Refer to “Formatting Attributes ” in Section 2 for a discussion
of these attributes.)
This command has two forms. Option 1 performs only display of items or values, and
option 2 performs both record selection and item display. These forms are discussed in
the following paragraphs.
Option 1
This form of the DISPLAY command is used in one of two ways:
Syntax
DISPLAY <display list>)
ALL )
OF <data set>
Explanation
The following table explains the elements of the DISPLAY command syntax diagram.
Element Description
<display list> Defined under “Common Syntactic Items” in this
section. Either lists items to be displayed from
selected records or specifies the arithmetic
expression or current record function whose value
is displayed.
ALL Displays all items of the most recently selected
record.
OF <data set> Displays all items of the most recently selected
record of this data set.
Examples
Example 1
In the following example, the Inquiry calculator mode is used to display the result of the
given SIN function:
SIN
------------------
-0.95941046464
#
Example 2
In both of the following examples records of the data sets ADR and JOB have been
selected in the order indicated using the following SELECT commands:
SELECT ADR
In the following example, the items ADR-EMP-NO, and ADR-STREET-NO are displayed
for the current ADR record:
ADR-EMP-NO ADR-STREET-NO
---------- ------------------------------
2 45 ALEXANDER RD DU BOIS PA
#
In the following example, all items from the last record selected (the record from JOB)
are displayed:
Option 2
This form of the DISPLAY command combines item display and record selection. It may
be used to display values from all records that meet a particular selection condition.
A limit may be included in this form of the DISPLAY command specifying the amount of
uninterrupted output to be displayed. When the specified number of records have been
displayed, Inquiry stops record selection and item display and waits for input from the
user. If this specified number is greater than the number of records that can be displayed
on a CRT, Inquiry displays as much information as possible and then waits for further
input. If the user wishes to continue the item display at this point, the NEXT command or
a blank input must be entered.
When items are selected using a link item or an embedded manual subset that refers to
one of its own ancestors, the user may specify that only the data portion of the selected
record is to be retrieved.
A REPEAT option may be specified with this form of the DISPLAY command. This option
causes Inquiry to execute statements associated with the specified data set and its
attached embedded structures. A REPEAT option is executed only when the selection
specifications preceding the option in the DISPLAY command have been satisfied.
Syntax
DISPLAY <display specification>)
<repeat option>
<display specification>
<display spec 1>)
<limit> <display spec 2> , <sort option>
<structure option>
<structure>)
DATA * AT <selection condition>
* IN )
WHERE
<repeat option>
THEN REPEAT <data set>)
, )
THEN
Explanation
The following table explains the elements of the DISPLAY command syntax diagrams.
Element Description
<display specification> Lists items, establishes selection conditions, or
designates structures for use in record display and
specifies any sorting of displayed records.
<repeat option> Establishes automatic looping between the
selected data set and the data set following
REPEAT. That is, after each display, the SELECT
command and DISPLAY command associated with
the data set specified in the repeat option (and any
of its attached, embedded data sets or repeated
data sets) are executed.
<limit> An integer specifying the number of records to be
displayed at a time.
<sort option> Defined under “Common Syntactic Items.”
<display list> Records in this list meeting the display
specification are displayed.
AT Precedes the selection condition for records to be
IN displayed.
WHERE
<selection condition> Defined under “Common Syntactic Items.”
VIA Precedes the structure option.
USING
<structure option> Displays records in the structure that satisfy the
selection condition.
<structure> Data set, set, subset, link item, or a temporary subset
created by the GENERATE command.
DATA Retrieves only the data portion of the selected link item
or embedded manual subset.
THEN Must precede REPEAT in the repeat option.
,
,THEN
REPEAT <data set> Executes most recent SELECT or DISPLAY command
associated with the data set.
Examples
Example 1
The following DISPLAY command displays records from the data set JOB for which
JOB-TYPE is 2 and JOB-TITLE is not VICE PRESIDENT. (Inquiry is able to determine from
the items specified which data set to use for displaying records.)
Example 2
The following DISPLAY command displays the same records as the commands in the
preceding example, but displays them in alphabetical order of job titles:
Example 3
In this example, a SET command is used to associate the DISPLAY command with the
data set ADR (refer to SET Command in this section):
Example 4
The following DISPLAY command displays records in the subset EMP-OVER10-SUBSET
for which EMP-DATE-HIRED is prior to December 12, 1960, then executes the
command associated with the data set ADR for each record displayed from EMP-
OVER10-SUBSET:
SELECT/DISPLAY Command
If Inquiry is used on a database containing embedded structures, the SELECT command
and option 2 of the DISPLAY command can be combined in a single input command to
display records from a structure embedded in the selected structure. Inquiry processes
the combined SELECT/DISPLAY command as a series of nested loops.
Once a record is selected at the lowest valid nesting level, if a select specification is
input for that level, Inquiry responds with a number sign (#) and waits for further input.
However, if a display specification is input, Inquiry processes all records in that structure
that satisfy the display specification.
When all records at this nesting level are exhausted, Inquiry attempts to retrieve a new
record at the next higher nesting level. If a display specification is input, Inquiry
automatically retrieves the next record in that structure that satisfies the display
specification and continues to process the original input command from that point. If all
records at this nesting level are exhausted, Inquiry proceeds to the next higher nesting
level. This process continues until either all records are exhausted or Inquiry encounters
a select specification.
Syntax
<command separator>
SELECT <select specification>)
DISPLAY <display specification> <repeat option>
<repeat option>
THEN REPEAT <data set>)
, )
THEN
<command separator>
THEN )
, )
THEN
Explanation
The following table explains the elements of the SELECT/DISPLAY command syntax
diagrams.
Element Description
<select specification> Establishes selection conditions or designates
structures for use in record selection and specifies
any sorting of selected records. (Refer to
“SELECT Command” in this section for complete
syntax and semantics.)
<display specification> Lists items, establishes selection conditions, or
designates structures for use in record display and
specifies any sorting of displayed records. (Refer
to “DISPLAY Command” in this section for
complete syntax and semantics.)
<repeat option> Causes commands associated with the data set
following REPEAT to be executed.
THEN Precedes REPEAT in the repeat option or
, separates SELECT and DISPLAY commands in the
,THEN combined command. THEN preceded by a comma
is required if the following SELECT or DISPLAY
command applies to an embedded structure.
REPEAT <data set> Executes most recent SELECT or DISPLAY
command associated with the data set.
Example
The following combined SELECT/DISPLAY command selects a record from EMP,
displays the items ED-INST-NAME, ED-COURSE, and ED-GPA for every school at which
the employee had a grade-point average better than 3.0, and executes the command for
the data set ADR (“DISPLAY ADR-STREET-NO,ADR-ZIP AT ADR-EMP-NO = EMP-NO”)
that has already been established by a SET command:
#%
ATTACH Command
Inquiry remembers the most recently entered command for each data set. The ATTACH
command is used to combine the command entered for an embedded data set with the
command entered for the master data set, thus allowing automatic looping between the
two structures. When the ATTACH command has been entered, the command
associated with the embedded data set is executed each time the command associated
with the master data set is executed. The combined command is executed using the
REPEAT command.
To attach an embedded data set to its master data set, the master data set must have a
current record.
Syntax
ATTACH <data set>)
Explanation
The data set construct identifies an embedded data set.
Example
In the following example, the buffers for the master data set EMP and for the embedded
data set EMP-ED are set to the specified DISPLAY commands, and then automatic
looping between the two structures is established using the ATTACH command:
2:ED-GPA
-------------------------------------------------------------------
1: 610101 UNIV OF MARYLAND 5266 SOC SCI
2: 2.89
1: 650615 KENT STATE 2123 PSYCHOLOGY
2: 3.77
#
CLEAR Command
The CLEAR command may be used to discard define items, virtual items, and generated
subsets. An item that has been cleared may no longer be referenced; however, such an
item may be re-established by one of the following methods:
• Using the RESTORE command (if the declaration had previously been saved)
• Recreating the item in the normal manner
The CLEAR command does not remove any declarations from the definitions file.
However, if a SAVE command is entered after a CLEAR command, or at the end of the
Inquiry session, the declarations that have been cleared are removed from the definitions
file. If SAVE is not entered, the cleared declarations remain available during concurrent
and subsequent Inquiry sessions.
Syntax
CLEAR DECLARATIONS )
* DEFINE )
* DEFINES <define item>)
* EXTRACT )
* GENERATE )
* GENERATES )
* REPORT )
* VIRTUAL )
* VIRTUALS )
*<define item>)
*<generated subset name>)
<virtual item>
Explanation
The following table explains the elements of the CLEAR command syntax diagram.
Element Description
DECLARATIONS Deletes all define, virtual, and generate items.
DEFINE Deletes all items of the specified type.
DEFINES
GENERATE
GENERATES
VIRTUAL
VIRTUALS
DEFINE <define item> Deletes individual items of the specified type.
DEFINES <define item>
<define item>
<generated subset name>
<virtual item>
Element Description
EXTRACT Deletes all information associated with a previously
entered EXTRACT command and resets extract
variables to their initial values and extract file attributes
to their default values.
REPORT Returns all internal storage used to remember the
report statements and generate the report; may be
entered to improve efficiency or to avoid possible
conflict between a previous report definition and a new
report generation.
Examples
Example 1
In the following example, the CLEAR command is used to remove all define items from
the database:
Example 2
In the following example, the CLEAR command is used to remove the generated subset
PROTECTORS:
CREATE Command
The CREATE command creates a new record to be added to a data set.
All items specified for the new record in a CREATE command must belong to the same
data set. In addition, any variables used in the specification of arithmetic items must
reference values in currently selected records of other data sets. The following types of
items cannot be specified in a CREATE command:
• Count items
• Link items
• Population items
• Record-type items
• Items declared as READONLY
Items of the record to be created that are not assigned values in the CREATE command
are initialized to one of the following values:
To override these defaults, NULL may be specified in the CREATE command for all data
items except required items and items such as Boolean items that cannot take a null
value. (Refer to the Enterprise Database Server DASDL Reference Manual for definitions
of these terms.)
Inquiry cannot create an embedded data set whose master (owner) data set has been
compiled with the DASDL option LOCK TO MODIFY DETAILS set. If you try to create an
embedded data set under these conditions, Inquiry responds with the following
message:
A CREATE operation causes any existing selection of the data set itself, or any selection
of any of its embedded data sets, to be discontinued. A successful CREATE operation
causes the newly created record to become the selected record.
To create records in an embedded data set, a record of the corresponding master data
set must be currently selected.
The CREATE command invokes the Enterprise Database Server Accessroutines. The
Inquiry CREATE command is equivalent to a user-language CREATE statement followed
by a STORE statement, and any violation of the normal Enterprise Database Server
restrictions related to the create and store operations causes an error condition. (Refer to
the Enterprise Database Server Application Programming Guide for details regarding
these statements and restrictions.) If such an error condition is detected, an error
message is displayed, and the record is not created.
Syntax
CREATE <create specification>)
<create specification>
<create list>)
<data set>)
(<record type>) WITH
<create list>
,
<alpha item> = <quoted alpha literal>)
NULL )
*<arithmetic item> = <arithmetic expression>)
NULL )
<Boolean item> = TRUE )
FALSE
Explanation
The following table explains the elements of the CREATE command syntax diagrams.
Element Description
<create specification> List of items and their values in the newly created
record. This list may include a specification of the data
set that will contain the created record, the record type
of the created record, or both.
<data set> Explicitly names the data set for which the record is to
be created. If qualification is required (that is, if all items
in the create list appear in more than one data set),
either a data set must be specified or the items must be
qualified in the usual way. (Refer to “Qualification” in
Section 2.) Otherwise, Inquiry can determine the proper
data set from the items referenced in the create list.
<record type> A positive integer specifying the record type for a data
set with variable-format records. Must appear when
creating a record for a data set with variable-format
records and must be one of the valid record types
specified in the DASDL for the database.
WITH An optional keyword that may be used to improve
readability.
<create list> Specifies items and their values in the new record.
<alpha item> Items in an existing data set that are assigned values in
<arithmetic item> the newly created record.
<Boolean item>
Element Description
<quoted alpha literal> Defined in the semantics under “Selection Condition” in
this section. Must be enclosed in quotes even if
OPTIONS QUOTES = FALSE. (Refer to “OPTIONS
Command” in this section.)
<arithmetic expression> Yields the value assigned to the arithmetic item in the
newly created record. Variables used in this expression
must reference values in currently selected records of
another data set.
Examples
Example 1
In the following example, a new record is created in the data set EMP for an employee
named Candy Stack:
Example 2
In the following example, a new record is created in the JOB data set for a custodial
engineer job:
DEFINE Command
The DEFINE command establishes a name that can be used as a shorthand notation for
any Inquiry text. This text can be an entire Inquiry command, several Inquiry commands,
or any part of an Inquiry command.
A define name cannot be the name of an Inquiry command, database item, or generated
subset.
A parametric define allows parameters to be supplied at the time the define item is
referenced. When a parametric define is referenced, the formal parameters appearing in
the text of the define are replaced by the actual parameters.
Syntax
DEFINE <define item name> = <text> )
,
( <parameter> )
Explanation
The following table explains the elements of the DEFINE command syntax diagram.
Element Description
<define item name> A unique identifier. Cannot be an Inquiry
command, database item identifier, or generated
subset name.
<text> Any legal Inquiry input text. For a
multiple-command define, the text cannot include
DEFINE, EDIT, or REPEAT-with-EDIT commands.
Each command in a multiple-command define
must be separated (and may be followed) by
semicolons.
<parameter> Establishes a variable to be used in define text.
Examples
Example 1
In the following example, the define item NEWHIRE is created to display the records of
employees hired after January 1, 1970:
#
-> NEWHIRE
Example 2
In the following example, the parametric define HIRERANGE is created to display the
records in EMP for employees hired between any two specified dates:
DELETE Command
The DELETE command removes the currently selected record from a data set. After this
command is executed, items from the deleted record may still be displayed until a new
record for that data set is selected.
If a record has not been selected for the data set, an error message is displayed and
deletion does not occur.
Inquiry cannot delete an embedded data set whose master (owner) data set has been
compiled with the DASDL option LOCK TO MODIFY DETAILS set. If you try to delete an
embedded data set under these conditions, Inquiry responds with the following
message:
DELETE invokes the Enterprise Database Server Accessroutines. Any violation of the
normal Enterprise Database Server restrictions related to the DELETE operation causes
an error condition, and an error message is displayed. If an error condition is detected,
deletion does not occur.
Deletions made to an audited database are audited in the usual Enterprise Database
Server manner. (Refer to “Modification of Audited Databases ” in Section 2 of this
manual.)
Syntax
DELETE <data set>)
Explanation
The data set construct deletes the currently selected record in the data set.
Example
In the following example, a specified record of the data set JOB is selected and then
deleted:
Because the deleted record remains the current record, items can be displayed from it:
JOB-CODE JOB-TITLE
-------- ------------------------------
3000 EXEC SECRETARY
#
#NONE
#
DETACH Command
The DETACH command separates an embedded data set from its master data set and
prevents automatic looping between the two data sets.
If the master data set and embedded data set are specified in the same SELECT or
option-2 DISPLAY command, they are attached by default.
When the master data set is selected, the embedded data set is marked as having no
current record. Inquiry displays an appropriate message if an attempt is made to display
any items contained in the embedded data set.
Syntax
DETACH <data set>)
Explanation
The data set construct identifies the embedded data set that is to be separated from its
master data set.
Examples
The embedded data set EMP-ED is attached to the master data set EMP using an
option 2 DISPLAY command:
%#
Because EMP-ED is detached from EMP, automatic looping between the two structures
is prevented. Thus, the following REPEAT command selects the first EMP record:
Because a record has been selected from EMP, EMP-ED has no current record, and no
items from EMP-ED can be displayed:
EMP-LNAME EMP-FNAME
---------- ----------
FIELDS JON
#
ED-GPA
------
#OWNER OF ED-GPA (EMP-ED) NOT SELECTED
#
EDIT Command
The EDIT command modifies the text in the current buffer.
The current buffer normally contains the text of the most recently entered DEFINE,
DISPLAY, GENERATE, SELECT, SET, or VIRTUAL command. The RECALL command
may be used to replace the contents of the current buffer by the text of a previously
entered command. (Refer to “RECALL Command” in this section.)
After each EDIT command is entered, the contents of the current buffer are displayed.
EDIT may be performed as many times as necessary to alter the contents.
To edit only the text of a specific line, the line number of the desired line must be
entered prior to the first delimiter. The line number must correspond to one of the lines
displayed; if not, a syntax error results. The line numbers are not saved; they merely
indicate the position of the line within the entire text. If any subsequent changes to the
text occur (for example, statement insertions or deletions), the line numbers of
succeeding lines also change. Consequently, when future EDIT operations take place,
new text and new line numbers are displayed.
EDIT does not REPEAT or reprocess the modified text; therefore, a sequence of
modifications may be lost if a REPEAT command is not entered before other input.
REPEAT-with-EDIT can be used to cause the new text to be processed immediately.
(Refer to “REPEAT Command” in this section.)
An EDIT command immediately followed by a save command is not enough to save the
edited version of a declaration. It is necessary to perform one of the following actions:
Syntax
EDIT <delim><text 1><delim>)
<line #> <text 2>
Explanation
The following table explains the elements of the EDIT command syntax diagram.
Element Description
<text 1> If <text 2> is specified, the <text 2> value
<text 2> replaces the first occurrence of <text 1>; If <text
2> is not specified, <text 1> values are
eliminated from the current buffer.
<delim> Can be any special character not contained in
text 1. Both <delim> occurrences must be the
same character.
<line #> Edits only this line in text.
Examples
Example 1
In the following example, the specifications for the generated subset RICHEMP are to be
edited. These specifications are reloaded using the RECALL command as follows:
Next, the EDIT command is used to change the specifications for RICHEMP:
The REPEAT command is then used to save the changed specifications, and the
generated subset that satisfies the changed specifications is displayed:
-> REPEAT
#WAIT
#
Example 2
In the following example, the VIRTUAL command that created the virtual item EMP-
YEAR-SALARY is reloaded into the current buffer and edited. The REPEAT command
causes Inquiry to remember the new specification for the virtual item. The edited virtual
item is then displayed for the first record in EMP:
-> REPEAT
-> S EMP
Example 3
In the following example, one of the four lines of text in the current buffer is edited:
-> SHOW
EXTRACT Command
The EXTRACT command names items in the selected record to be extracted to a file and
specifies the format of these items in the extract file. The GENERATE command initiates
the actual extraction process; an extract file and a report can be generated using a single
GENERATE command.
• Database items, including count, population, record-type, and group items. Link
items may not be specified. If an item is declared with an OCCURS clause, the
subscript must be provided; this subscript may be an arithmetic expression.
• Virtual items.
• Inquiry functions.
• Arithmetic expressions.
Items may be renamed in the record layout summary. If a new name is not specified,
database items and virtual items keep their original names, and functions and arithmetic
expressions are assigned names by Inquiry.
Extracted items may be reformatted. Table 3–1 indicates the allowable format
specifications and the default formats used for the extract file.
Alpha Default No No No
Boolean No Yes Default Yes
Field No Default Yes Yes
Number No Yes Default Yes
Real No Yes Yes Default
Inquiry Func. No Yes Yes Default
Arith. Exp. No Yes Yes Default
Population No Default Yes Yes
Record-Type No Default Yes Yes
Count No Default Yes Yes
Group Default No No No
Format Explanation
ALPHA This format resizes an alpha source item. The specified item
size for this format may be no larger than 4095. If the specified
item size is smaller than the source-item size, the left-most
characters of the source item appear in the extract file and the
right-most characters are truncated.
FIELD Items in this format appear as unsigned, binary integers.
Boolean source items are converted to field items with binary
values of 0 or 1. Number and real source items, including Inquiry
functions and arithmetic expressions, are converted to
unsigned, binary integers. The specified item size for this format
must be less than 48; this value is always rounded to the
nearest 4-bit multiple.
NUMBER This format extracts source items as signed or unsigned,
fractional or integer values. Number items may add or delete a
sign or change or delete a scale factor when extracted in this
format. Boolean, field, and real items are converted to a number
item with the specified precision and, optionally, the specified
scale factor. The maximum specified precision is 23 for
unsigned items and 22 for signed items; if specified, the scale
factor may not exceed the specified precision.
REAL This format extracts source items as signed or unsigned,
fractional or integer values. Values are represented in
single-precision, floating-point form. The size is 1 word (12 4-bit
digits). Boolean, field, and number items may be extracted in
this format. The maximum specified precision for unsigned
items is 12 and for signed items is 11. If specified, the scale
factor may not exceed the specified precision.
By default, source items are extracted in their original format. Arithmetic expressions
and Inquiry functions are extracted in REAL format. Boolean items are extracted as
1-digit, unsigned values in NUMBER format. Count, field, and population items are
extracted in FIELD format; a field item is treated as an unsigned, binary integer
regardless of whether the field item contains Boolean items. If individual bits are
extracted, the Boolean bit names must be used. By default, each Boolean bit is then
extracted as a 1-digit value in NUMBER format; however, the bit could be reformatted in
the same way as a Boolean source item.
The EXTRACT command may specify the starting position for items in the extract record.
The first position in the extract record is zero. Alpha and real source items must begin on
byte boundaries (that is, the specified starting position must be an even number).
Specified items must be listed in order of increasing position; a COLUMN OVERLAP
error occurs if the position specified for an item is a position before the ending of the
previous item. Unused space between items in the extract file is described in the record-
layout summary as FILLER with a 4-bit zero value for the appropriate number of digits.
Error conditions that may be caused during extract procedures are listed below along
with the resulting default values for items in the extract file.
The EXTRACT command can specify error actions to be taken for each extracted item or
for all extracted items. (In the event of conflicting specifications, the specification for an
individual item takes precedence.) In addition, the EXTRACT command can specify
extract values, which override the default extract values in the event of an error.
Syntax
EXTRACT )
<error action> <extract list>
<error action>
,
[ NULL HIGH-VALUE ] )
* CONVERSION ) = * LOW-VALUE ) WARNINGS
FAULT * BLANKS )
TERMINATE
<extract list>
,
<id>)
*/1\ <format> )
*/1\ <extract position> )
/1\ <error action>
<id>
<item>)
<layout name> =
<format>
ALPHA ( <item size> ) )
* FIELD
* NUMBER ( <precision> )
REAL S , <scale factor>
<extract position>
<integer>)
AT
Explanation
The following table explains the elements of the EXTRACT command syntax diagrams.
Element Description
EXTRACT If no other options are specified, displays or prints
record-layout summary for previously entered
EXTRACT command.
<error action> Specifies action to be taken in the event of extract
errors.
<extract list> Specifies items to be extracted, position of each
item in the extract record, and action to be taken in
the event of extract errors.
NULL Specify actions in the event the specified extract
CONVERSION error occurs.
FAULT
Element Description
HIGH-VALUE In the event of specified error, value of extracted
LOW-VALUE items is all bits ON or OFF, respectively.
BLANKS In the event of specified error, value of extracted
items is all blanks.
TERMINATE In the event of specified error, extracts remaining
fields in the current extract record, terminates the
extract process, and generates a WARNINGS
message. After termination, the current data set
record is accessible to other Inquiry commands.
WARNINGS In the event of specified error, generates a message
containing the extract key, type of error, and item in
error. This option is RESET by default.
<format> Specifies reformatting for extracted items.
<extract position> Specifies starting position for extracted item in the
extract record.
<id> Specifies item name in record layout summary.
<layout name> An alphanumeric identifier of 17 or fewer characters
beginning with a letter.
ALPHA Specifies format of item in extract file.
FIELD
NUMBER
REAL
(<item size>) Specifies size of item extracted in ALPHA or FIELD
format.
(<precision>) Specifies precision of an item extracted in NUMBER
or REAL format.
S Used for signed items extracted in NUMBER or
REAL format.
<scale factor> Must not exceed the precision.
AT Precedes the extract position specification.
Example
The EXTRACT command in this example makes the following specifications for the
extract file:
FILE Command
The FILE command displays or sets commonly used file attributes for an extract file. The
assigned values must be valid for the specified attributes (refer to the attribute
descriptions in the I/O Subsystem Programming Guide for valid values).
The default attribute values are 20 for AREAS, 1000 for AREASIZE, 30 for BLOCKSIZE,
and EXTRACT/<database name> for TITLE. (The CLEAR EXTRACT command resets
extract file attributes to their default values.)
Normally, the FILE command is entered after the EXTRACT command has determined
the default MAXRECSIZE. If the MAXRECSIZE specified in the FILE command is smaller
than the default value, the extract record is truncated. If the MAXRECSIZE specified in
the FILE command is larger than the default value, the extract record is padded with 4-bit
zeros.
If a value is specified for the INTNAME attribute, this attribute is set so that file-equated
attributes in a WFL statement can be attached to the extract file.
Syntax
FILE EXTRACT )
,
AREAS <integer>
* AREASIZE ) =
* BLOCKSIZE )
* MAXRECSIZE
* TITLE <file name>)
=
INTNAME <identifier>
=
Explanation
The following table explains the elements of the FILE command syntax diagram.
Element Description
FILE EXTRACT If no other options are specified, displays values of
extract file attributes.
AREAS Assigns values to the specified attributes.
AREASIZE
BLOCKSIZE
MAXRECSIZE
TITLE
INTNAME
= May be included for documentation.
Element Description
<file name> Name specified to override the default extract file
name.
<identifier> Value assigned to the INTNAME attribute of the
extract file.
Examples
Example 1
The following FILE command displays the default values for Inquiry extract file attributes:
Example 2
The following FILE command displays the extract file attribute values for the file created
in the example under “EXTRACT Command” in this section:
Example 3
The following FILE command changes the value of the MAXRECSIZE attribute to 2, the
value of the AREASIZE attribute to 500, and the value of the TITLE attribute to
EXT/DIV68 for the file in the preceding example:
GENERATE Command
The GENERATE command can be used
• To generate a report.
• To create an extract file containing the items named in the EXTRACT command.
• To generate a temporary subset of a data set. This temporary subset can then be
referenced by other Inquiry commands.
This command has two forms. Option 1 creates a report or an extract file, and Option 2
creates a temporary subset. These forms are discussed in the following paragraphs.
Option 1
This form of the GENERATE command is used to create reports or extract files, or both.
If a report is generated, conditions for the data set used to generate the report must
have been previously established by the SELECT, SET, or ATTACH commands. (Refer to
the descriptions of these commands in this section.) If multiple copies of a report are
desired, the GENERATE command may be repeated as many times as desired.
Note: If other users are concurrently updating the database, each report may be
different.
The report generation process can be canceled by entering the CANDE ?AX command.
If an extract file is created, file attributes for the extract file are set by the FILE
command. When the extract is complete, the extract file is locked with CRUNCH. (That
is, the file is closed and saved as a permanent disk file in such a way that the unused
portion of the last row of disk space is returned to the system.) Any file with the current
extract file title is removed.
Both an extract file and a report can be created using a single GENERATE command, if
the same selection conditions are true for both.
Syntax
,
GENERATE /1\ EXTRACT <data set>)
/1\ REPORT VIA HOLD
Explanation
The following table explains the elements of the option 1 GENERATE command syntax
diagrams.
Element Description
EXTRACT Generates an extract file.
REPORT Generates a report.
VIA May be included to improve readability.
<data set> Contains the items to be reported or extracted.
HOLD Holds the first output line of a report until a blank is
entered. (This process allows a hardcopy terminal
to be positioned at the top of a page so that the
physical page control is synchronized with the
report generation process.)
Examples
Examples illustrating the use of option 1 GENERATE commands may be found under
“Inquiry Report” and “Inquiry Extract” in Section 2, and under “REPORT Command”
and “EXTRACT Command” in this section.
Option 2
This form of the GENERATE command is used to create a temporary subset. The
generated subset contains only the records that satisfy the condition at the time the
subset is created. Although the text used to generate the generated subset can be
saved, Inquiry discards the generated subset at the end of each session.
If UPDATE is allowed for the database, and new records are created that satisfy the
condition for a generated subset, the generated subset is updated to include the new
records only after a RECALL is performed on the generated subset, followed by a
REPEAT.
Syntax
GENERATE <generated subset name> = <select specification>)
<subset expression>
<subset expression>
<generated subset name 1> )
* AND <generated subset name 2>
* OR )
* + )
Explanation
The following table explains the elements of the option 2 GENERATE command syntax
diagrams.
Element Description
<generated subset name> Generates a temporary subset, which can then be
referenced by SELECT and DISPLAY commands.
Must be a unique identifier and must not be
identical to any database item name, define item
name, virtual item name, generated subset name,
or Inquiry command. May be used instead of the
structure construct in a SELECT or DISPLAY
command.
Because temporary subsets are known only to
INQUIRY, the Accessroutines cannot guarantee the
integrity of the subset while the database is
undergoing change. Temporary subsets should be
regenerated following any update which affects the
contents of the subset or the records within the
subset. Because changes may be made by other
user programs without detection by INQUIRY,
generated subsets should never be used as the
basis for updating a database.
<select specification> Defined under “SELECT Command” in this section.
<generated subset name Must refer to the same data set.
1>
<generated subset name
2>
AND, OR, +, – May be used to form a generated subset from two
existing generated subsets. These operations are
defined in the following table, where G refers to
the generated subset with
<generated subset name>, G1 to the generated
subset with <generated subset name 1>, and G2
to the generated subset with
<generated subset name 2>.
Generated
Subset Explanation
G = G1 AND Each entry in G is contained in
G2 both G1 and G2 (subset
intersection).
G = G1 OR G2 Each entry in G is contained in
either G1, or G2, or both (subset
union).
Generated
Subset Explanation
G = G1 + G2 Each entry in G is contained in
either G1 or G2, but not both
(subset exclusive OR).
G = G1 – G2 Each entry in G is present in G1
and is absent from G2 (subset
difference).
Examples
Example 1
The following GENERATE command creates the temporary subset RICHEMP from the
data set EMP:
# WAIT
#
+
Example 2
The following GENERATE command creates the temporary subset OLDTIMERS from
the data set EMP:
Example 3
The following GENERATE command creates the temporary subset TRUSTIES from the
intersection of the subsets RICHEMP and OLDTIMERS:
Example 4
The following GENERATE command creates the temporary subset CRONIES from the
union of the subsets RICHEMP and OLDTIMERS:
-> GENERATE CRONIES = RICHEMP OR OLDTIMERS
Example 6
The following GENERATE command creates the subset DEFENDERS from the subset
difference between RICHEMP and OLDTIMERS:
HELP Command
The HELP command displays either syntax or semantics for Inquiry statements or
diagnostic information.
If the file DMINQ/HELP is not present, HELP information is not available and the system
responds with a message indicating that this file is not present.
Syntax
HELP )
* VERBS )
<verb>)
SEMANTICS
Explanation
The following table explains the elements of the HELP command syntax diagram.
Element Description
HELP If no other options are specified, displays the most
recent Inquiry error message.
VERBS Displays a list of the Inquiry verbs.
<verb> Displays the syntax of the verb. The entire name of
the verb must be entered; abbreviations are not
allowed.
SEMANTICS Displays the semantics for the verb.
Examples
Example 1
The following HELP command displays syntax for the SORT command:
SORT )
,
CORE <integer>
DISK =
Example 2
The following HELP command displays semantics for the SORT command:
NEXT Command
The NEXT command causes Inquiry to continue record selection and item display from
the most recent stopping point.
Syntax
NEXT )
*<data set>)
?
Explanation
The following table explains the elements of the NEXT command syntax diagram.
Element Description
NEXT If no other options are specified, continues record
selection and item display at the point that the most
recently entered command stopped.
<data set> Continues processing the most recently entered
command at the point where the next record is to be
selected for this data set. This point need not be the
point at which the command stopped.
? Displays the name of the next data set to be selected.
Examples
Example 1
In the following example, the NEXT command is used to execute the DISPLAY
command for the second record in ED-INST-NAME that satisfies the specified selection
condition:
EMP-LNAME ED-INST-NAME
---------- ------------------------------
FIELDS UNIV OF MARYLAND
#
-> NEXT
EMP-LNAME ED-INST-NAME
---------- ------------------------------
FIELDS CARLETON
#
Example 2
The following NEXT command executes the same DISPLAY command for the second
record in EMP that satisfies the specified selection condition:
EMP-LNAME ED-INST-NAME
---------- ------------------------------
HARDWICK UCLA
#
Example 3
The following NEXT command displays the name of the next data set to be selected:
-> NEXT ?
EMP-ED
#
OPTIONS Command
The OPTIONS command controls the destination and contents of the output from
DISPLAY and REPORT commands.
Syntax
OPTIONS PRINTER )
* TERMINAL )
* COMMENTS )
* NULL ) * TRUE )
QUOTES = FALSE
Explanation
The following table explains the elements of the OPTIONS command syntax diagram.
Element Description
TERMINAL Lists output generated by DISPLAY or REPORT
PRINTER commands on the user’s terminal or the system line
printer. TERMINAL is set by default. These options
can be set at any time and remain set throughout
the Inquiry session or until they are explicitly
altered. If the output is directed to the printer, the
number of lines per page and the number of
characters per line may be specified using the
PRINTER command. (Refer to “PRINTER
Command” in this section.)
COMMENTS Displays DASDL comments along with the identifier
COMMENTS TRUE when the SHOW command is used.
COMMENTS FALSE Suppresses the display of DASDL comments.
COMMENT is FALSE by default.
NULL Displays all items regardless of value. Two hyphens
NULL TRUE are displayed for NULL items. NULL is TRUE by
default.
NULL FALSE Suppresses display of NULL items when
TERMINAL FORMAT TAB or TERMINAL FORMAT
SINGLE is used. (Refer to “TERMINAL Command”
in this section.)
QUOTES Requires alpha literals to be quoted alpha literals
QUOTES TRUE (that is, to begin and end with quotation marks).
QUOTES is TRUE by default.
QUOTES FALSE Allows quotation marks to be omitted from alpha
literals.
Element Description
Care must be taken in using alpha literals when
QUOTES is FALSE. Alpha literals in UPDATE and
CREATE commands must always be quoted alpha
literals. The TITLE command accepts either quoted
alpha literals or unquoted alpha literals. However, the
TITLE options DATE and TIME are not interpreted as
unquoted alpha literals, and alpha literals containing
special characters or embedded blanks must be
quoted. (Also refer to the discussion of unquoted
alpha literals under “Selection Condition” in this
section.)
Quoted alpha literals may be used at any time, even if
QUOTES is FALSE.
= May be included to improve readability.
Examples
Example 1
The following example illustrates terminal output when the OPTIONS PRINTER
command is executed:
# DISPLAY # 1 ON PRINTER
# 2 RECORDS FOR EMP PRINTED.
#
Example 2
In the following example, an OPTIONS COMMENTS is executed to display the DASDL
comment, in quotes, along with the DASDL description of the embedded data set EMP-
ED:
PRINTER Command
The PRINTER command displays or alters the printer file attributes assigned by Inquiry.
These attributes are active only if OPTIONS PRINTER is set. (Refer to “OPTIONS
Command” in this section.)
The PRINTER command may specify a different INTNAME attribute for the printer file. If
so, any file attributes associated with the specified file at the time Inquiry is initiated are
associated with the printer file. If the printer file is open, it is closed, and its title and
INTNAME are both set to the specified file name. If no file-equation WFL statement is
supplied for this file name, the file reverts to the default printer file with the specified file
name as its title.
Any special requirements for the printer file should be anticipated. FILE is not required to
produce normal printer files, but can be used when additional printer file characteristics
are sought.
Note: PRINTER is the original INTNAME of the printer file. The printer file is not
actually opened until the file is explicitly required by an Inquiry command; consequently,
this process may be repeated as often as necessary.
Syntax
PRINTER )
,
FORMAT HEADING
= * SINGLE )
TAB )
* PAGE <integer>)
* WIDTH =
FILE <file name>
=
Explanation
The following table explains the elements of the PRINTER command syntax diagram.
Element Description
PRINTER If no other options are specified, displays the
current printer attributes.
FORMAT Selects one of the three specified output formats.
HEADING Refer to “Formatting Attributes” in Section 2.
SINGLE
TAB
PAGE Specifies the number of lines displayed on each
page.
WIDTH Specifies the number of characters displayed on
each line.
Element Description
FILE Changes the INTNAME of the printer file to the
designated file name.
= May be included to improve readability.
Examples
Example 1
The following PRINTER command sets the page width to 55 columns and the number of
lines printed to 10:
Example 2
The following examples show Inquiry display messages from the generation of printer
output and the printer output using the specifications from the previous example in each
of the three output formats:
# DISPLAY # 1 ON PRINTER
# 1 RECORDS FOR EMP PRINTED.
#
***DISPLAY # 1
EMP-NO=1 EMP-LNAME=FIELDS
EMP-FNAME=JOHN EMP-SSN=533733557
EMP-DATE-HIPED=720312 EMP-SEC-CLEAR=TRUE
EMP-SALARY=5000.00
# DISPLAY # 2 ON PRINTER
# 1 RECORDS FOR EMP PRINTED.
#
*** DISPLAY # 2
1:EMP-NO EMP-LNAME EMP-FNAME EMP-SSN
2:EMP-DATE-HIRED EMP-SEC-CLEAR EMP-SALARY
----------------------------------------------
1: 1 FIELDS JON 533733557
2: 720312 TRUE 5000.00
# DISPLAY # 3 ON PRINTER
# 1 RECORDS FOR EMP PRINTED.
#
*** DISPLAY # 3
EMP-NO = 1
EMP-LNAME = FIELDS
EMP-FNAME= JON
EMP-SSN =533733557
EMP-DATE-HIRED = 720312
EMP-SEC-CLEAR = TRUE
EMP-SALARY = 5000.00
QUIT Command
The QUIT command terminates an Inquiry session.
Before the session is terminated, the text of all define, generate, and virtual items must
be saved or discarded. If QUIT is entered and define, generate or virtual items have been
added, deleted or modified but not saved, or if the declarations are saved in any file other
than the default file, the following message is displayed:
If a SAVE command is then entered, the declarations are saved and the Inquiry session
is terminated. If QUIT is entered again, the Inquiry session is terminated and the
declarations are discarded.
After QUIT is entered, Inquiry responds with the following message before closing the
database:
#TERMINATING Inquiry
Syntax
QUIT )
RECALL Command
The RECALL command loads the current buffer with the text of the specified command,
generated subset, or item and displays this text on the terminal. Once the text has been
recalled, it may be modified using the EDIT command or executed using the REPEAT
command.
Syntax
RECALL DEFINE <define item>)
* EXTRACT )
* REPORT )
* SUMMARY CONTROL )
REPORT )
* TITLE PAGE )
REPORT )
*<data set>)
* UPDATE )
CREATE )
*<generated subset>)
<virtual item>
Explanation
The following table explains the elements of the RECALL command syntax diagram.
Element Description
DEFINE <define item> Loads and displays text associated with the define
item. Each command of a multiple-command define
is displayed on a separate line, preceded by a line
number and a colon (:).
EXTRACT Loads and displays previously entered EXTRACT
commands.
REPORT Loads and displays previously entered REPORT
commands. (In some instances, changes to the
report list may require changes to the SUMMARY
command.)
SUMMARY CONTROL Loads and displays text associated with the
SUMMARY REPORT specified SUMMARY command.
TITLE PAGE Loads and displays text associated with the
TITLE REPORT specified TITLE command.
<data set> Loads and displays the text of SELECT and DISPLAY
commands associated with the data set.
<data set> UPDATE Loads and displays text of UPDATE or CREATE
<data set> CREATE commands associated with the data set.
<generated subset> Loads and displays the text of the associated
GENERATE command.
Element Description
<virtual item> Loads and displays the text of the associated
VIRTUAL command.
Examples
Example 1
The following RECALL command reloads and displays the text of the DEFINE command
that created the define HIRERANGE (in the second example under “DEFINE Command”
in this section):
Example 2
The following RECALL command reloads and displays the text of the GENERATE
command that created the generated subset RICHEMP (in the first example under
“GENERATE Command” in this section):
Example 3
The following RECALL command reloads and displays the text of the VIRTUAL
command that created the virtual item EMP-YEAR-SALARY (in the example under
“VIRTUAL Command” in this section):
REDEFINE Command
The REDEFINE command allows the changing of a define or a virtual while the define or
virtual is in use.
Syntax
REDEFINE <define command>)
<virtual command>
Explanation
The following table explains the elements of the REDEFINE command syntax diagram.
Element Description
<define command> Changes the text associated with a define identifier.
Inquiry will forget the old text and remember the
new text. Any command using the define identifier
will now reference the new text.
<virtual identifier> Changes the vale of a virtual identifier. Inquiry will
forget the old value and calculate the new value.
This command is similar to clearing the virtual and
re-entering it with a new value except that
references to this virtual by other virtuals are not
checked.
Examples
Example 1
The following REDEFINE command changes the text associated with the define
SHOWDEX:
Example 2
The following REDEFINE command shows the difference between the use of the
REDEFINE command and the use of the combination of the CLEAR and VIRTUAL
commands.
REPEAT Command
The REPEAT command causes the command in the current buffer to be executed.
REPEAT may be used to modify and execute the command in the current buffer within
one operation; this operation is identical to an EDIT followed by a REPEAT. (Refer to the
examples below.) If more than one line of text is present, specification of a line number
before the first delimiter causes the editing specifications to refer to that particular line. If
this line number does not correspond to one of the lines displayed, a syntax error occurs.
The line numbers are not saved. Each number indicates only the relative position of a line
within the entire text; therefore, if subsequent changes occur, such as command
insertions or deletions, the line numbers change. For this reason, whenever subsequent
editing operations take place, new text and line numbers are automatically displayed.
Similarly, Inquiry remembers the text of the most recent SELECT or DISPLAY command
associated with each data set. Thus, if a REPEAT is entered for a specified data set,
statements associated with the data set or with attached embedded data sets are
executed.
The SET command may be used to associate a REPEAT command with a particular data
set. For example, the following SET statement would associate a REPEAT <data set 2>
command with <data set 1>:
In this case, if a REPEAT <data set 1> statement is subsequently executed, the
commands associated with <data set 2> are automatically executed at the same time
the REPEAT <data set 1> command is executed. In Inquiry terms, automatic looping has
been established between <data set 1> and <data set 2>. <data set 1> and <data set
2> in this example need not be related. In fact, the establishment of looping using the
REPEAT command is the only way in which Inquiry allows access to information
contained in records of different disjoint data sets. (Refer to “Related Records Across
Data Sets” in Section 2.)
Syntax
REPEAT )
*<data set>)
* <delim> <text 1> <delim> )
<line #> <text 2>
Explanation
The following table explains the elements of the REPEAT command syntax diagram.
Element Description
REPEAT If no other options are specified, executes the
command in the current buffer.
<data set> Executes the most recent SELECT or DISPLAY
command associated with this data set.
<delim> Any special character not contained in the construct
text 1. Both delim values must be the same
character.
<text 1> If the text 2 value is specified, the text 1 value is
<text 2> replaced by the text 2 value. If the text 2 value is not
specified the text 1 value is eliminated. Only the first
occurrence of the text 1 value is affected.
Examples
Example 1
In the following example, the REPEAT command is used to edit the define item
SHOWZIP and replace the original text with the new text:
Example 2
In the following example, a SET command is used to establish a REPEAT command for
the JOB data set and, thus, to establish automatic looping between the JOB data set
and the EMP data set:
#WAIT
1:JOB-COUNT JOB-TYPE JOB-CODE JOB-TITLE
2:TYPE-SPEED SHORTHAND-SPEED CRTUSE-REQD SPANISH-REQD
3:DRIVING-REQD JOB-COMMENT
-------------------------------------------------------------------
1: 1 2 3333 SALESMAN
2: -- -- -- TRUE
3:FALSE MINUMUM 2 YRS FIELD EXP
EMP-LNAME EMP-FNAME EMP-DATE-HIRED
---------- ---------- --------------
FIELDS JON 720312
HARDWICK ALICE 701214
JONSON BEN 620115
#
For additional examples, refer to “Related Records Across Data Sets” in Section 2 and to
“ATTACH Command” and “EDIT Command” in this section.
REPORT Command
The REPORT command specifies the items to be listed on an Inquiry report and controls
the format of the report.
• Any database item except a group name. If the item has an OCCURS clause, the
subscript may be an arithmetic expression.
• A virtual item.
• An arithmetic function.
• An arithmetic expression.
Items specified in a REPORT command are printed in columnar format. If these items
cannot fit on the current output device line, Inquiry displays a warning message. The
output device and/or device attributes must be changed before the report is generated or
an error message will be given.
If the specified items for a report directly or indirectly (for example, through expressions
or virtuals) reference a data set other than the data set specified in the GENERATE
REPORT <data set> command, and no current record is present for that data set, then
the specified items are undefined on the report and appear as one or two hyphens (-).
Certain items specified in the REPORT command may be designated report control
items. These items appear on the report in the following form:
<item>:<value>
A control break occurs when the value of any report control item changes between two
adjacent records. At this time, processing of records stops and any summary information
requested by a previous SUMMARY CONTROL command is tabulated. (Refer to
“SUMMARY Command” in this section.) To provide proper report generation control, the
SORT option should be used to sort the selected records in order of the report control
items, if the records have not been selected in that order. The SET command should be
used to specify the sort criteria, in order to avoid redundant calls on the system SORT
intrinsic.
The starting column and column width may be specified for each item in the report. If no
starting column is specified for an item, the column starts one character beyond the
point where the previous column left off. A COLUMN OVERLAP message is displayed if
the specified starting column is less than one position beyond the ending of the previous
column.
If no column width is specified, the column width is assumed to be the largest of either
the number of characters in the column name or the number of characters required to
present the data value with7out loss of significance. In addition, the TRUNCATE option is
ignored.
If the specified column width is not large enough to hold the column name, the
specification is ignored and a column width large enough to hold the column name is
assumed. If the specified column width is not large enough to hold the data to be
formatted, the default action depends on the data type, as follows:
Syntax
REPORT <report list>)
<report list>
<id list>)
<control list>
<control list>
,
<id> : )
PAGE TRUNCATE
<id list>
,
<id>)
<colstart> <colwidth> TRUNCATE
<id>
<item>)
<colname> =
<colstart>
<integer>)
AT
Note that <colstart> added to <colwidth> must not exceed the device line size.
<colwidth>
# <integer>)
* WIDTH )
FOR
Explanation
The following table explains the elements of the REPORT command syntax diagram.
Element Description
<report list> Lists items to be reported.
<control list> Specifies report control items. Report control items
group records with the same value for that item on
the report.
<id list> Specifies items to appear in columns.
<id> The item name or specified colname value.
: Separates report control items from other displayed
items.
PAGE Causes a new page to be started if a control break
occurs.
TRUNCATE For alpha variables, specifies that any characters that
do not fit on a line are truncated from the right. If
TRUNCATE is not specified, the entire alpha variable
is printed, using multiple lines if necessary; however,
trailing blanks are suppressed. (This option is ignored
for non-alpha variables.)
<colstart> Specifies the starting position of a column on the
report page.
Note that the sum of the colwidth value and the
colstart value must not exceed the device line size.
<colwidth> Specifies the number of character positions in which
a value is formatted.
Note that the sum of the colwidth value and the
colstart value must not exceed the device line size.
<colname> An alphanumeric literal used to specify the name
printed as the column name on the report. The
colname value must begin with a letter and cannot
be longer than 17 characters. If a colname value is
not provided, the item name is used.
Examples
Example 1
The following SET command establishes a SELECT command containing a selection
expression to be used when a report is generated. The SELECT command also sorts the
selected records in order of JOB-CODE:
The REPORT command is then used to specify the report format. The item JOB-TITLE is
specified as a report control item. In addition, the column headings in the report for the
items JOB-CODE and JOB-COMMENT appear as CODE and COMMENT, respectively.
The job codes in the report appear beginning in column 5 and extend for 4 columns. The
job comments in the report appear beginning in column 15 and extend for 50 columns.
The following REPORT command contains these specifications:
# STARTING REPORT
PAGE 1
JOB-TITLE : PROJECT MANAGER
CODE COMMENT
---- --------------------------------------------------
5000 3 YRS MANAGEMENT EXP PLUS DEGREE
JOB-TITLE : CONTROLLER
CODE COMMENT
---- --------------------------------------------------
8888 --
.
.
.
PAGE 2
JOB-TITLE : VICE PRESIDENT
CODE COMMENT
---- --------------------------------------------------
9999 --
# REPORT COMPLETED
Example 2
The REPORT command in the following example contains the same specifications as
that in the previous example, except that a PAGE option is added to start a new page
each time a control break occurs:
# STARTING REPORT
PAGE 1
JOB-TITLE : PROJECT MANAGER
CODE COMMENT
---- --------------------------------------------------
5000 3 YRS MANAGEMENT EXP PLUS DEGREE
.
.
.
PAGE 2
JOB-TITLE : ADM ASSIST
CODE COMMENT
---- --------------------------------------------------
7000 --
.
.
.
PAGE 3
JOB-TITLE : SALES MANAGER
CODE COMMENT
---- --------------------------------------------------
7777 5 YRS SALES EXP PLUS DEGREE
.
.
.
PAGE 4
JOB-TITLE : CONTROLLER
CODE COMMENT
---- --------------------------------------------------
8888 --
.
.
PAGE 5
JOB-TITLE : VICE PRESIDENT
CODE COMMENT
---- --------------------------------------------------
9999 --
# REPORT COMPLETED
Example 3
In the following example, the column specifications for the report generated in the first
example are edited so that the values appearing in the report must be broken over a
number of lines:
-> REPEAT
# STARTING REPORT
PAGE 1
JOB-TITLE : PROJECT MANAGER
CODE COMMENT
---- --------------------
5000 3 YRS MANAGEMENT EXP
PLUS DEGREE
# REPORT COMPLETED
#
Example 4
If the TRUNCATE option had been specified for the COMMENT column in the preceding
example, the report would be output as follows:
# STARTING REPORT
PAGE 1
JOB-TITLE : PROJECT MANAGER
CODE COMMENT
---- --------------------
5000 3 YRS MANAGEMENT EXP
JOB-TITLE : CONTROLLER
CODE COMMENT
---- --------------------
8888 --
.
.
.
PAGE 2
JOB-TITLE : VICE PRESIDENT
CODE COMMENT
---- --------------------
9999 --
# REPORT COMPLETED
#
Example 5
In the following example, the report generated from EMP includes the result of the
arithmetic function SQRT over the virtual item EMP-YEAR-SALARY for each employee in
EMP:
#
-> GENERATE REPORT VIA EMP
# STARTING REPORT
PAGE 1
EMP-LNAME EMP-SALARY SQRT
---------- ---------- ------------------
FIELDS 2000.00 154.919333848
KRANTZ 3050.00 191.311264697
JONSON 1771.56 145.803703657
DEKKER 1950.00 152.970585408
CHAPMAN 2805.00 183.466618218
MARLOWE 2200.00 162.480768093
BURNS 1750.00 144.913767462
MITTY 2000.00 154.919333848
JOYCE 2450.00 171.464281995
STACK 4500.00 232.379000773
# REPORT COMPLETED
#
RESTORE Command
The RESTORE command reloads previously saved declarations. If a file is specified in a
RESTORE command, the contents of that file are restored. The specified file must have
been created previously using a SAVE command. If no file name is specified, Inquiry
restores declarations from the default definitions file. (The title of this file is specified
when running BUILDINQ; refer to “Inquiry Generation” in Appendix A.) If the
declarations file was saved under a usercode other than that of the Inquiry user, or under
the system file directory using an asterisk (*), the usercode or asterisk must be specified
in the RESTORE command. Nonprivileged users cannot access files saved in the system
file directory (*) or under a usercode other than their own.
Normally, when a declaration created during an Inquiry session and a saved declaration
have the same name, RESTORE retains the existing declaration and discards the saved
declaration. However, the RESTORE command may specify that the saved declaration is
to replace the existing declaration.
RESTORE does not execute any of the declarations or regenerate any subsets created
by the GENERATE command. The RECALL and REPEAT commands can be used to
re-establish generated subsets.
Syntax
RESTORE )
*<file name> OVERWRITE
* * )
( <usercode> )
Explanation
The following table explains the elements of the REPORT command syntax diagram.
Element Description
RESTORE If no other options are specified, reloads declarations
from the default definitions file.
<file name> Reloads saved declarations in this file.
OVERWRITE Replaces existing declaration with the original saved
declaration.
* Specified file containing declarations to be reloaded
is on the system directory.
(<usercode>) Specified file containing declarations to be reloaded
is on this usercode.
Examples
Example 1
The following RESTORE command reloads the virtual item, generated subset, and define
item saved in the default definitions file:
RESTORE
Example 2
The following RESTORE command would reload the definitions stored in the file
DEFAULTDEF on usercode MADDOG:
RESTORE (MADDOG) DEFAULTDEF
Example 3
The following RESTORE command would reload the definitions stored in the file
DEFDEFAULT on the system directory:
RESTORE *DEFDEFAULT
Example 4
The following example illustrates the use of the RESTORE OVERWRITE command. First,
the saved virtual item EMP-YEAR-SALARY is recalled, edited, and repeated (to preserve
the edited version of the virtual item). The RESTORE OVERWRITE command is then
used to replace the existing (that is, newly changed) virtual item EMP-YEAR-SALARY
with the original virtual item saved in the default definitions file.
-> RECALL EMP-YEAR-SALARY
-> REPEAT
#
SAVE Command
The SAVE command stores the text of DEFINE, VIRTUAL, and GENERATE commands.
Use of this command allows a user to declare these statements during one Inquiry
session and save them for use during subsequent sessions.
Inquiry saves the most current declarations. If a SAVE is entered after declarations have
been added, deleted, or modified, a new save file is created and the old file, if any, is
removed.
If the SAVE command specifies a file name, Inquiry saves the declarations in a file with
the specified name. If no file name is specified, the declarations are saved in the
definitions file. (The title of the definitions file is specified when running BUILDINQ; refer
to “Inquiry Generation” in Appendix A of this manual.)
If an asterisk (*) precedes the specified file name, the file is saved in the system file
directory. If a usercode precedes the specified file name, the file is saved under that
usercode. (In these cases, the file is available only to privileged users because only
privileged users are allowed to create or save system files or files under other
usercodes.) If neither an asterisk nor a usercode is specified, the definitions file is saved
under the terminal user’s usercode.
Syntax
SAVE )
*<file name>
* * )
( <usercode> )
Explanation
The following table explains the elements of the SAVE command syntax diagram.
Element Description
SAVE If no other options are specified, stores text of
DEFINE, VIRTUAL, and GENERATE commands.
<file name> Declarations are saved in a file with this name.
* Declarations are saved in the specified system file.
(<usercode>) Declarations are saved in the specified file under this
usercode.
Examples
Example 1
In the following example, the SAVE command is used to save the newly created define
item SHOWZIP. Then, a message is displayed indicating that the old definitions file that
did not contain SHOWZIP is removed. It is replaced by the new definitions file containing
SHOWZIP:
-> SAVE
Example 2
In the following example, the SAVE command is entered at the time the Inquiry session
is terminated to save the declarations created during that session:
-> QUIT
-> SAVE
SET Command
The SET command is used to associate the text of one or more Inquiry commands with
a specified data set. In addition, Inquiry remembers the most recently entered text of
CREATE, DISPLAY, LIMIT, SELECT, SORT, REPEAT, and UPDATE commands for each
data set, and the SET command can be used to modify or delete the text of these
commands stored in the specified data set. If new text is specified, the new text
replaces the stored text; if NONE is specified, the stored text is deleted.
SET only changes the text associated with the data set; it does not elect a record,
update a record, or display an item. The RECALL command may be used to load the text
for commands associated with the data set into the current buffer. The EDIT command
may be used to edit this text, and the edited command may then be executed using a
REPEAT command or stored using a SET command.
The SET command may be used to establish a REPEAT command for a data set and,
thus, automatic looping between that data set and an unrelated data set. (Refer to
“REPEAT Command” in this section for an explanation of automatic looping. Examples
of automatic looping may be found there or under “Related Records Across Data Sets”
in Section 2.)
Syntax
SET <data set>)
* CREATE <create specification>)
TO NONE )
* DISPLAY <display specification>)
*<display list>)
*<limit>
NONE )
* LIMIT <limit>)
* = ) NONE )
TO
* REPEAT <data set>)
NONE )
* SELECT <select specification>)
NONE )
* SORT <sort specification>)
NONE )
UPDATE <update list>)
NONE
Explanation
The following table explains the elements of the SAVE command syntax diagram.
Element Description
<data set> Stores, modifies, or deletes command text
associated with this data set.
TO May be included to improve readability.
=
NONE Eliminates the specified text.
CREATE Changes or eliminates the create specification
associated with the data set.
DISPLAY Changes or eliminates the display specification
associated with the data set. A new select
specification or limit can be included in the display
specification. (Refer to “DISPLAY Command” for
definitions of these constructs.)
LIMIT Modifies or eliminates the limit associated with the
data set. When LIMIT is set for a data set, Inquiry
causes a page wait after <limit value> records have
been displayed from the data set. To continue the
display, transmit a blank.
LIMIT specifications are ignored for reports.
REPEAT Modifies or eliminates the REPEAT specification
associated with the data set.
SELECT Modifies or eliminates the select specification
associated with the data set. When the select
specification is changed or eliminated, no current
record remains selected for the data set or for any
data set embedded within the data set.
SORT Modifies or eliminates the sort specification
associated with the data set.
UPDATE Modifies or eliminates the update list associated with
the data set.
Examples
Example 1
In the following example, the SET command is used to establish a DISPLAY command to
be associated with ADR (which is then executed using a REPEAT command):
Example 2
The following SET command changes the number of lines specified in the DISPLAY
command associated with ADR:
SHOW Command
The SHOW command displays the contents of the current buffer, virtual items, define
items, generated subset specifications, or specified parts of the DASDL declaration of a
database.
Syntax
SHOW )
* ALL )
OF <data set> )
* DATASETS )
* DECLARATIONS )
* GLOBAL )
* DEFINE )
* DEFINES <define item>)
* GENERATE )
* GENERATES <generated subset>)
* VIRTUAL )
* VIRTUALS <virtual item>)
,
*<identifier>)
<data set>)
* ITEMS )
SETS
*<set>)
<data item>
Explanation
The following table explains the elements of the SHOW command syntax diagram.
Element Description
SHOW If no other options are specified, displays the
contents of the current buffer.
ALL Displays the DASDL description of the portion of the
database or logical database that Inquiry was
generated to access.
ALL OF <data set> Displays the DASDL description of the data items,
<data set> sets, and subsets associated with this data set.
DATASETS Displays the names of all data sets in the database.
Element Description
DECLARATIONS Displays the names and text associated with all
define items, generated subsets, and virtual items.
GLOBAL Displays the description of all global items contained
in the database.
DEFINES Displays the name and text for all define items or for
DEFINES the specified define item.
DEFINE <define item>
GENERATE Displays the name and text for all generated subsets
GENERATES or for the specified generated subset.
GENERATE
<generated subset>
VIRTUAL Displays the name and text for all virtual items or for
VIRTUALS the specified virtual item.
VIRTUAL <virtual item>
<identifier> Displays the DASDL description of the specified data
set, set, or data item. If the identifier is a data set
identifier, this form is synonymous with SHOW ALL
OF <data set>.
<data set> ITEMS Displays the DASDL description of the data items in
<data set> SETS this data set or of the sets associated with this data
set.
<set> Displays the DASDL description of the set and
indicates which data set the set references.
<data item> Displays the DASDL description of the data item and
the name of the data set that contains the item.
Examples
Example 1
In the following examples, SHOW commands are used to display the virtual item,
generated subsets, and define item that have previously been declared for the sample
database:
Example 2
In the following example, a SHOW command is used to display the DISPLAY command
contained in the current buffer:
-> SHOW
Example 3
The following SHOW command displays the DASDL description of the global items in
the sample database:
GLOBAL ITEMS:
FISCAL-YEAR NUMBER (6)
POP-EMP POPULATION OF EMP
DIV-NUMBER NUMBER (5)
#
Example 4
The following SHOW command displays the DASDL description of the item JOB-CODE
in the JOB data set:
Example 5
The following SHOW command displays the DASDL description of the embedded set
ED-DATE-SET:
SORT Command
The SORT command displays or alters the SORT core and disk parameters used by the
sort option of the SELECT and DISPLAY statements.
By default, the SORT is allocated 12,000 words of core and 600,000 segments of disk. In
general, increasing the amount of core increases the speed of the sort.
The disk size specified must be sufficient to contain the tag file.
Syntax
SORT )
,
CORE <integer>
DISK
Explanation
The following table explains the elements of the SORT command syntax diagram.
Element Description
SORT If no other options are specified, displays the current
values for SORT core and SORT disk.
CORE <integer> Assign new values for the SORT core and disk
DISK <integer> parameters.
Examples
Example 1
The following SORT command displays the current default values for the SORT core and
disk parameters:
-> SORT
CORE = 12000
DISK = 600000
#
Example 2
The following SORT command changes the SORT core parameter to 13,000 words of
core and the SORT disk parameter to 610,000 segments of disk:
SUMMARY Command
The SUMMARY command allows statistical information to be included in a report. The
functions used to produce the statistical information are defined under “Arithmetic
Function” in this section.
Both SUMMARY REPORT and SUMMARY CONTROL can be used within a single
report.
Syntax
SUMMARY CONTROL G
FOR REPORT
G NONE )
,
,
COUNT ( <id> )
* AVG )
* SSQ )
* MSQ )
* VAR )
* STD )
* SUM )
* TOTAL )
* MIN )
MAX
Explanation
The following table explains the elements of the SUMMARY command syntax diagram.
Element Description
FOR May be included to improve readability.
CONTROL Specifies that statistical information is to be
processed and displayed at control breaks. A control
break occurs each time a report control item in the
report list changes value. (Refer to “REPORT
Command” for a definition of report control items.)
The order of control items is significant when more
than one is listed. The first control item listed is the
most important and the last is least important. When
a control break occurs, control summaries for the item
causing the break and items subordinate to it are
printed. Summaries for the items superordinate to the
item causing the break are not printed.
REPORT Prints the report summary as an extra page after the
report is generated.
NONE Eliminates a previous SUMMARY command.
Element Description
<id> An identifier in the REPORT command report list. For
SUMMARY CONTROL, the identifier must be in the
REPORT command identifier list. If a colname value is
specified for an item in the report list, the identifier
must be the colname value. (Refer to “REPORT
Command” in this section.)
TOTAL Synonym for the arithmetic function SUM.
Examples
Example 1
In the following example, a number of employee records are selected from the data set
EMP for a report. The SUMMARY command is then used to generate summary
information for the sum of the salaries of the selected employees, the average of these
salaries, the minimum salary, and the maximum salary along with the specified report
information. This summary information is output as a separate page at the end of the
report:
#STARTING REPORT
PAGE 1
EMP-LNAME EMP-FNAME EMP-SSN EMP-DATE-HIRED EMP-SALARY
---------- ---------- --------- -------------- ----------
FIELDS JON 533733557 720312 5000.00
HARDWICK ALICE 647938292 701214 5000.00
JONSON BEN 540022677 620115 1771.56
DEKKER THOMAS 554998666 711104 1950.00
.
.
.
PAGE 2
SUMMARY FOR REPORT
#REPORT COMPLETED
#
Example 2
In the following example, the JOB-TYPE, JOB-CODE, and JOB-TITLE of every record in
the JOB data set are output for a report. The SUMMARY command is then used to
output the number of jobs that correspond to each JOB-TYPE along with the report
information. This summary information is output at each control break (that is, each time
the report control item JOB-TYPE changes value in the report).
#STARTING REPORT
PAGE 1
JOB-TYPE : 0
JOB-TYPE JOB-TITLE JOB-CODE
-------- ------------------------------ --------
0 VICE PRESIDENT 9999
0 ACCOUNTANT 4000
0 CONTROLLER 8888
0 ADM ASSIST 7000
====
(SUBTOTAL
FOR
JOB-TYPE)
COUNT 4
JOB-TYPE : 1
JOB-TYPE JOB-TITLE JOB-CODE
-------- ------------------------------ --------
1 RECEPTIONIST 2345
1 SECRETARY 1000
====
(SUBTOTAL
FOR
JOB-TYPE)
COUNT 2
.
.
.
PAGE 2
JOB-TYPE : 2
JOB-TYPE JOB-TITLE JOB-CODE
-------- ------------------------------ --------
2 SALESMAN 3333
2 SALES MANAGER 7777
2 PROJECT LEADER 5000
====
(SUBTOTAL
FOR
JOB-TYPE)
COUNT 3
# REPORT COMPLETED
#
TERMINAL Command
The TERMINAL command displays or alters the values assigned by Inquiry for the
terminal attributes SCREEN, FORMAT, PAGE, and WIDTH. The initial values for the
PAGE, WIDTH, and SCREEN attributes depend on the terminal being used.
Syntax
TERMINAL )
,
SCREEN TRUE
= FALSE )
* FORMAT HEADING )
= * SINGLE )
TAB )
* PAGE <integer>
WIDTH =
Explanation
The following table explains the elements of the TERMINAL command syntax diagram.
Element Description
TERMINAL If no other options are specified, displays the current
terminal attributes.
SCREEN Must be TRUE for CRT terminals. SCREEN may be
used with other terminal types to limit the amount of
uninterrupted output.
FORMAT Specifies one of the three output formats.
HEADING Refer to “Formatting Attributes” in Section 2.
TAB
SINGLE
PAGE Specifies the number of lines displayed per page on
CRT terminals.
WIDTH Controls the number of characters displayed on each
line. Some terminals are designed to perform an
automatic line advance after printing in the last
character position of the line; for this reason, Inquiry
restricts output to one character less than the WIDTH
value specified.
= May be included to improve readability.
Examples
Example 1
The TERMINAL command in the following example displays the current values of the
terminal attributes:
-> TERMINAL
WIDTH = 70
PAGE = 23
SCREEN = TRUE
FORMAT = HEADING
#
Example 2
The TERMINAL command in the following example makes these specifications for
terminal output:
• In HEADING format.
• 60 characters displayed per line.
• 15 lines displayed per page on the terminal screen.
TITLE Command
The TITLE command defines the specifications for report titles.
The length of a report-title line cannot exceed the line width of the output device. For
reports directed to line printers, the line width is equal to the printer width. For reports
directed to hardcopy terminals, the line width is equal to the terminal width. For reports
directed to screen terminals, the line width is equal to the terminal width minus one
column. In addition, the centered first line of a title appearing on every page of a report
uses the last 10 columns for the page number; thus, the length of this line cannot
exceed the line width minus 21.
Syntax
TITLE REPORT <title list>)
PAGE = NONE
<title list>
/
DATE )
* TIME )
<alpha literal>
<alpha literal>
<quoted alpha literal>)
<unquoted alpha literal>
Explanation
The following table explains the elements of the TITLE command syntax diagrams.
Element Description
REPORT Defines a title page for a report. The title is centered
on the page; however, a report title is optional.
PAGE Defines a title for the top of every page of a report.
This title is optional.
= May be included to improve readability.
<title list> Specifies contents of each report title line.
NONE Eliminates a previous title.
DATE Prints the current date as part of the title in the
following form:
<month>/<day>/<year>
Element Description
<quoted alpha literal> Defined in the semantics under “Selection Condition”
<unquoted alpha literal> in this section.
If OPTION QUOTES is TRUE, the alpha literal must be
a quoted alpha literal.
If OPTION QUOTES is FALSE, the alpha literal can be
either a quoted alpha literal or an unquoted alpha literal.
However, the DATE and TIME options are not
interpreted as unquoted alpha literals, and any alpha
literals containing special characters or embedded
blanks must be quoted.
/ Produces multi-line titles. Each occurrence of the
slash (/) indicates that the following title text appears
on a new line.
Examples
Example 1
In the following example, the TITLE command is used to add a title page to the
beginning of the report generated by the REPORT command in the example under
“REPORT Command” in this section:
#STARTING REPORT
---- --------------------------------------------------
5000 3 YRS MANAGEMENT EXP PLUS DEGREE
JOB-TITLE : CONTROLLER
CODE COMMENT
---- --------------------------------------------------
8888 --
.
.
.
PAGE 2
JOB-TITLE : VICE PRESIDENT
CODE COMMENT
---- --------------------------------------------------
9999 --
# REPORT COMPLETED
Example 2
The TITLE command in the following example places the title specified in the previous
example at the top of each page in the report (new pages are indicated in this example
by the vertical ellipses):
#STARTING REPORT
.
.
.
JOB-TITLE : CONTROLLER
CODE COMMENT
---- --------------------------------------------------
8888 --
.
.
.
14:15
#REPORT COMPLETED
#
UPDATE Command
The UPDATE command modifies the value of data items in the currently selected record
and then stores the updated record in the data set. Each data item specified in the
UPDATE command is assigned the new value specified in the command.
All data items appearing in an UPDATE command must belong to the same data set. In
addition, items used in an arithmetic expression that provides a value for an arithmetic
item must be in the data set being updated, or in currently selected records of other data
sets at a higher nesting level.
• Count items
• Key items for which no duplicates are allowed (the default condition for key items)
• Link items
• Population items
• Record-type items
Inquiry cannot update an embedded data set whose master (owner) data set has been
compiled with the DASDL option LOCK TO MODIFY DETAILS set. If you try to update an
embedded data set under these conditions, Inquiry responds with the following
message:
Inquiry remembers the most recent update list for each data set. This list can be
accessed using a RECALL command or modified using a SET command. (Refer to
“RECALL Command” and “SET Command” in this section.)
UPDATE invokes the Enterprise Database Server Accessroutines. Any violations of the
normal Enterprise Database Server restrictions related to the STORE function cause an
error condition and result in the display of an error message. If an error condition is
detected, updating is not performed.
Updates made to an audited database are audited in the usual Enterprise Database
Server manner. (Refer to “Modification of Audited Databases” in Section 2.)
Syntax
UPDATE <data set>)
<update list>
<update list>
,
<alpha item> = <quoted alpha literal>)
NULL )
*<arithmetic item> = <arithmetic expression>)
NULL )
<Boolean item> = TRUE )
FALSE
Explanation
The following table explains the elements of the UPDATE command syntax diagrams.
Element Description
<data set> Executes the most current update list for this data set.
If a record has not been selected, or an update list has
not been specified for this data set, an error message
is displayed and no update is performed.
<update list> Specifies items to be updated in the current record of
the selected data set and the new values for these
items.
<alpha item> Items in the currently selected record.
<arithmetic item>
<Boolean item>
<quoted alpha literal> Defined in the semantics under “Selection Condition”
in this section. Must be enclosed in quotes even if
OPTIONS QUOTES = FALSE. (Refer to “OPTIONS
Command” in this section.)
<arithmetic expression> Defined under “Selection Condition” in this section.
NULL Sets data items to their DASDL-defined null values.
Required items and items such as Boolean items that
cannot take null values cannot be set to NULL.
Examples
Example 1
In the following example, the first record of the data set EMP is selected, and the items
EMP-SALARY and EMP-SEC-CLEAR are updated. The updated record is then displayed:
-> D ALL
The next record of EMP is then selected, updated, and displayed. (Because the same
update list is used to update the second record, only the name of the data set is
specified in the UPDATE command.)
-> NEXT
Example 2
The following example shows how a record from an embedded data set is updated. First
a record is selected from both the master data set EMP, and the associated record in the
embedded data set EMP-ED is selected. Then, the UPDATE command is executed for
the selected embedded record:
VIRTUAL Command
The VIRTUAL command creates a virtual item and associates it with the specified
arithmetic expression.
Virtual items can be used in display lists or selection conditions. All Inquiry rules
concerning the use of arithmetic expressions and functions must be followed.
If the arithmetic expression contains functions, these functions must apply to items
contained in records at the next lower nesting level. (Refer to “Functions” in Section 2.)
Inquiry recognizes when the value of a virtual item must be recomputed. When this
situation occurs, Inquiry recomputes the arithmetic expression and assigns the new
value to the virtual item.
Syntax
VIRTUAL <virtual item name> = <arithmetic expression> )
Explanation
The following table explains the elements of the VIRTUAL command syntax diagram.
Element Description
<virtual item name> A unique identifier.
<arithmetic expression> Defined under “Selection Condition” in this section.
Example
In the following example, the virtual item EMP-YEAR-SALARY is created based on the
item EMP-SALARY:
Inquiry can be generated to access an entire database, selected data sets within a
database, or a logical database. Inquiry can be generated for a maximum of 1700
structures including data sets, sets, subsets, Accesses, and remaps.
Multiple copies of Inquiry may be generated for a database. Each copy of Inquiry may
access different data sets, and each may allow or disallow database modification.
Note: Inquiry does not support double precision numbers. If you require double
precision numbers in your queries, consider using a product such as the Interactive
Query Facility (IQF). For more information on IQF, refer to the InfoExec IQF Operations
Guide.
Inquiry Files
Inquiry is generated from the following files:
Inquiry Generation
The following paragraphs describe the required operations for generating Inquiry from
remote terminals and card readers.
1. The user runs the BUILDINQ program by entering the following statement:
RUN $SYSTEM/BUILDINQ
The user then enters the database name. The syntax for the database name is:
<database name>!
" * ! $ ON DISK !
$ ( <usercode> ) - " PACK !
$<pack name>-
If you are using Inquiry against a Remote Database Backup (RDB) secondary database,
the pack name must identify the location of the database control file on the
secondary host.
3. If the DESCRIPTION/<database name> file and the DATABASE/PROPERTIES file are
both present, BUILDINQ displays the following message:
WHICH SOFTWARE?
1 DMINQUIRY
2 DMINTERPRETER
The user enters 1 to specify that BUILDINQ is to build a directory for the Inquiry
program.
The user enters YES to disallow the UPDATE, CREATE, and DELETE commands or NO
to allow any of these statements. If NO is entered, BUILDINQ displays the following
message:
ALLOW UPDATE (YES OR NO)?
1 TOTAL DATABASE
2 SELECTED DATASETS
3 LOGICAL DATABASE
If no logical databases are declared for the database, option 3 is not displayed. The user
enters 1, 2, or 3 to specify which portion of the database is to be accessible to
Inquiry.
Option 1 allows Inquiry access to all database structures.
Option 2 allows Inquiry access to selected database structures. If this option is chosen,
BUILDINQ displays the following prompt:
FOR FOLLOWING DATASETS ENTER
BUILDINQ then displays the name of each disjoint data set in the database and waits for
a response after each name is displayed. The user must enter E, I, C, or * to specify
the action to be performed for each displayed data set. If * is entered, BUILDINQ is
terminated and must be restarted. If C is entered, BUILDINQ stops displaying the list
of data sets and proceeds to step 6.
Option 3 allows Inquiry access to one logical database. If this option is chosen,
BUILDINQ displays the following prompt:
ENTER LOGICAL DATABASE NAME
At this point, the user must enter the name of the logical database. The name entered
for the logical database must not specify a logical database in which an embedded
set is invoked more than once, since this would result in a “REMAP EMBEDDED
SET INVOKED TWICE” error.
6. When the desired option has been selected, BUILDINQ asks:
INQUIRY PROGRAM NAME (NULL FOR DEFAULT)?
“(NULL FOR DEFAULT)” appears in the display only if option 1 or option 3 has been
selected and the database name does not contain any special characters. If a null
input is transmitted in response to the prompt, the following default name is used
for the Inquiry program:
OBJECT/INQUIRY/<inquiry name>
In this form, the inquiry name is the database name if option 1 was selected or the
logical database name if option 3 was selected.
If the user wishes to supply a name for the Inquiry program, or if option 2 was selected,
the Inquiry program name has the same form as the default name, except that the
inquiry name is the name supplied by the user. The supplied name may contain from
1 to 11 identifiers separated by slashes. Each identifier may contain from 1 to 17
alphanumeric characters. Care must be taken in selecting an Inquiry program name
because any existing file with the same name as the specified <inquiry name> is
removed.
7. When the Inquiry program has been named, BUILDINQ asks:
WHAT QUEUE (NULL FOR DEFAULT)?
If a null input is entered, Inquiry is compiled in the system default queue; otherwise,
Inquiry is compiled in the queue specified by the user.
8. When the queue has been selected, BUILDINQ asks:
DEFINITION FILE NAME(NULL FOR DEFAULT)?
The user can then assign a name to the default definitions file used by the Inquiry SAVE
and RESTORE commands. If a null input is entered, the default definitions file has
the following form:
(<usercode>)DEFINITIONS/<inquiry name>
In this form, the usercode is the Inquiry user's usercode, not the usercode under which
BUILDINQ is run.
If the default name is not desired, the definitions file name may be specified using
the following syntax:
<file name>!
" * ! $ ON DISK !
$ ( <usercode> ) - " PACK !
$<pack name>-
In this form, the file name may contain from 1 to 11 identifiers separated by slashes.
Each identifier may contain from 1 to 17 alphanumeric characters. If a usercode is
specified, nonprivileged users running under other usercodes are not able to access
the definitions file.
When the default definitions file has been named, BUILDINQ performs an ALGOL ZIP to
compile the Inquiry program. The result of the ZIP compilation is a code file with the
following title:
OBJECT/Inquiry/<inquiry name>
This title may be prefixed by a usercode. The code file is placed on the device specified
by the usercode and FAMILY statement.
1. The Inquiry remote-generation procedure proceeds as normal; the user enters the
appropriate CANDE RUN command for BUILDINQ, and BUILDINQ displays the
request:
WHAT DATABASE?
At this point, instead of entering the database name, the user enters:
$NOZIP
2. BUILDINQ accepts this entry and then repeats the original prompt:
WHAT DATABASE?
The database name should then be entered. When $NOZIP is used, BUILDINQ does not
request the queue specification. If BUILDINQ is run from cards, the QUEUE
statement is ignored, if present.
If you are using Inquiry against a Remote Database Backup (RDB) secondary database,
enter the database name and include the pack location of the database control file on
the secondary host, for example, enter MYDB ON SECPACK.
To compile the Inquiry program after using the $NOZIP option, the following cards must
be included in a job deck and executed:
When compiled in this way, instead of OBJECT/Inquiry/<inquiry name> the name of the
Inquiry facility can be specified to be any name the user desires.
The file-equation cards may require modification, depending on the location of the files
being used.
Card Explanation
DATABASE : <database name> If this card is present, the database description
file is found in a file titled
DESCRIPTION/<database name>. If this card is
omitted, the user must provide the title of the
database description file by label-equating the
DASDL file of BUILDINQ.
$ NOZIP If this card is present, BUILDINQ produces the
DMINQDIRECTORY but does not compile
Inquiry.
UPDATE If this card is present, the database can be
updated using Inquiry.
CREATE If this card is present, records can be added to
the database using Inquiry.
DELETE If this card is present, records can be deleted
from the database using Inquiry.
INQNAME : <inquiry name> If this card is present, the generated Inquiry
program is named
(<usercode>)OBJECT/INQUIRY/<inquiry name>;
otherwise, the default name
(<usercode>)OBJECT/INQUIRY/<database name>
is used, unless the deck contains an LDBNAME
card. In that case, the default name
(<usercode>)OBJECT/INQUIRY/<logical database
name> is used.
Card Explanation
LDBNAME : If this card is present, access to the specified
<logical database name> logical database is assumed; otherwise, access to
the total database is assumed. The logical
database name must refer to a logical database
declared in DASDL. If the logical database invokes
the same structure more than once, the error
message “STRUCTURE INVOKED TWICE” will be
displayed and the generation halted.
QUEUE : <integer> If this card is present, INQUIRY is compiled in the
specified queue; otherwise, INQUIRY is compiled
in the system default queue.
DEFNAME : If this card is present, the definitions file is named
<definitions file name> (<usercode>)DEFINITIONS/<definitions file
name>; otherwise, the default name
(<usercode>)DEFINITIONS/<database name> is
used.
The CARD input file for BUILDINQ may be label-
equated to a file of type DISK, REMOTE, or
READER.
If an error is encountered when the BUILDINQ job
deck is run, an appropriate error message is
displayed and BUILDINQ terminates.
Examples
The following job deck uses the DATABASE card to specify the database whose
description file is used to build INQUIRY:
The following job deck label-equates the DASDL file title for the database whose
description file is used to build INQUIRY:
Required Files
All database files plus the following files must be present to run Inquiry:
The user may initiate Inquiry through CANDE by entering the following statement:
The user may also initiate Inquiry using a job deck that includes the following cards:
Efficiency Considerations
Inquiry can be run either in main memory or in swapspace.
If one terminal inquires against the database at a time, Inquiry should be run entirely in
swapspace (SUBSPACE=3).
If several users are running Inquiry concurrently, Inquiry should be run with code in main
memory and data in swapspace (SUBSPACE=1). In this case, a single copy of the code
can be shared by all users.
If only a few (three or four) terminals inquire against a database but many batch inquiries
occur, Inquiry should be run entirely in main memory (SUBSPACE=0).
For other combinations of batch and remote users, Inquiry should be run entirely in
swapspace (SUBSPACE=3).
For example, assume the database DASDL contains the following data set and set
declaration:
If you do not want this selection condition to generate a linear search, change the
DASDL definition of the key for the set A-SET to the following:
$ LINENUM
$ DUMP
The user should then repeat the Inquiry command that caused the error. The $DUMP
option causes a program dump to occur when the error is encountered again. The
$LINENUM option causes Inquiry to display the line number in DATABASE/DMINQ at
which the error occurred.
$ - LINENUM
$ - DUMP
Operational Description
Inquiry may be run either from remote terminals or from card readers. The following
paragraphs describe the operations for each kind of run.
The Inquiry name is the name of the database or the name selected during Inquiry
generation. If the user is not allowed access to the database, Inquiry responds:
#INITIALIZING Inquiry
#ACCESS DENIED
#INITIALIZING Inquiry
Normally, Inquiry commands are entered on a single line and executed immediately.
However, an Inquiry command may exceed the line width of the terminal; in this case, a
percent sign (%) may be entered at the end of the line to indicate that more input is to
follow. When the line is transmitted, Inquiry responds with a number sign followed by a
percent sign (#%) to indicate that additional input may be entered. This process can be
repeated as many times as necessary. When the command is complete, the user can
transmit the last line; the entire Inquiry command is then executed. A percent sign
should not be entered for the last line of the command.
The user may wish to enter an input command but delay the processing of this
statement until a later time. To cause Inquiry to store such a command, the user enters
the command as described above; however, the last line of input must end with two
percent signs (%%). The user then uses the REPEAT command to execute the
command. The SHOW command may be used to display the stored command before it
is executed; if desired, the EDIT command may then be used to modify the stored
command. (Refer to “EDIT Command,” “REPEAT Command,” and “SHOW Command”
in Section 3.)
Several Inquiry commands can be entered for immediate execution using a single,
multiple-command input. A multiple-command input is created by using semicolons (;) as
separators between the commands entered as input.
Some Inquiry input commands may produce a large amount of output. In these cases,
the user can discontinue output by pressing the terminal BREAK key. When BREAK is
entered, Inquiry discards all remaining output, displays a number sign (#), and waits for
new input.
Some Inquiry statements may require a long time to produce an answer. If Inquiry
detects this condition, it displays a #WAIT message.
The user can interrupt output at any time by using the BREAK key, or by entering the
CANDE ?BRK command if the terminal has no BREAK key. When output is interrupted,
Inquiry discontinues the current command, displays #STOPPED, and waits for new input.
Note: A number sign (#), or any system-produced message preceded by a pound sign
(except #WAIT), is an indication that Inquiry is waiting for additional input from the user.
The output from an Inquiry batch run contains the input messages printed along with the
associated output messages. No output is directed to the REMOTE file.
Paths
Paths show the order in which the command or statement is constructed and are
represented by horizontal and vertical lines. Many commands and statements have a
number of options so the railroad diagram has a number of different paths you can take.
REMOVE
SOURCE
OBJECT
The three paths in the previous example show the following three possible commands:
• REMOVE
• REMOVE SOURCE
• REMOVE OBJECT
• Mandatory items
• User-selected items
• Order in which the items must appear
• Number of times an item can be repeated
• Necessary punctuation
Follow the railroad diagrams to understand the correct syntax for commands and
statements. The diagrams serve as quick references to the commands and statements.
Constants are never enclosed in angle brackets (< >) and are in uppercase letters.
A variable is an item that represents data. You can replace the variable with data that
meets the requirements of the particular command or statement. When replacing a
variable with data, you must follow the rules defined for the particular command or
statement.
In the following example, BEGIN and END are constants, whereas <statement list> is a
variable. The constant BEGIN can be abbreviated since it is partially boldfaced.
• BE
• BEG
• BEGI
Constraints
Constraints are used in a railroad diagram to control progression through the diagram.
Constraints consist of symbols and unique railroad diagram line paths. They include
• Vertical bars
• Percent signs
• Right arrows
• Required items
• User-selected items
• Loops
• Bridges
Vertical Bar
The vertical bar symbol (|) represents the end of a railroad diagram and indicates the
command or statement can be followed by another command or statement.
Percent Sign
The percent sign (%) represents the end of a railroad diagram and indicates the
command or statement must be on a line by itself.
STOP %
Right Arrow
The right arrow symbol (>)
• Is used when the railroad diagram is too long to fit on one line and must continue on
the next
• Appears at the end of the first line, and again at the beginning of the next line
Required Item
A required item can be
• A constant
• A variable
• Punctuation
If the path you are following contains a required item, you must enter the item in the
command or statement; the required item cannot be omitted.
A required item appears on a horizontal line as a single entry or with other items.
Required items can also exist on horizontal lines within alternate paths, or nested (lower-
level) diagrams.
In the following example, the word EVENT is a required constant and <identifier> is a
required variable:
EVENT <identifier>
User-Selected Item
A user-selected item can be
• A constant
• A variable
• Punctuation
User-selected items appear one below the other in a vertical list. You can choose any
one of the items from the list. If the list also contains an empty path (solid line) above the
other items, none of the choices are required.
In the following railroad diagram, either the plus sign (+) or the minus sign (–) can be
entered before the required variable <arithmetic expression>, or the symbols can be
disregarded because the diagram also contains an empty path.
<arithmetic expression>
+
Loop
A loop represents an item or a group of items that you can repeat. A loop can span all or
part of a railroad diagram. It always consists of at least two horizontal lines, one below
the other, connected on both sides by vertical lines. The top line is a right-to-left path
that contains information about repeating the loop.
45 ; 7
8<field value>8
Bridge
A loop can also include a bridge. A bridge is an integer enclosed in sloping lines (/ \) that
The bridge can precede both the contents of the loop and the return character (if any) on
the upper line of the loop.
Not all loops have bridges. Those that do not can be repeated any number of times until
all valid entries have been used.
In the first bridge example, you can enter LINKAGE or RUNTIME no more than two
times. In the second bridge example, you can enter LINKAGE or RUNTIME no more than
three times.
45 , 7
8/2\ LINKAGE 8
RUNTIME
45/2\7
8 LINKAGE 8
RUNTIME
In some bridges an asterisk (*) follows the number. The asterisk means that you must
cross that point in the diagram at least once. The maximum number of times that you
can cross that point is indicated by the number in the bridge.
45 , 7
8/2*\ LINKAGE 8
RUNTIME
In the previous bridge example, you must enter LINKAGE at least once but no more than
twice, and you can enter RUNTIME any number of times.
The following railroad diagram indicates only one path that requires the constant
LINKAGE and the variable <linkage mnemonic>:
• Loops
• User-selected items
• A combination of loops and user-selected items
More complex railroad diagrams can consist of many alternate paths, or nested (lower-
level) diagrams, that show a further level of detail.
For example, the following railroad diagram consists of a top path and two alternate
paths. The top path includes
• An ampersand (&)
• Constants that are user-selected items
These constants are within a loop that can be repeated any number of times until all
options have been selected.
The first alternative path requires the ampersand and the required constant ADDRESS.
The second alternative path requires the ampersand followed by the required constant
ALTER and the required variable <new value>.
45 , 7
& 8 TYPE 8
D ASCII D
D BCL D
D DECIMAL D
D EBCDIC D
D HEX D
D OCTAL D
ADDRESS
ALTER <new value>
Example 1
<lock statement>
LOCK ( <file identifier> )
Example 2
<open statement>
OPEN <database name>
INQUIRY
UPDATE
Example 3
<generate statement>
GENERATE <subset> = NULL
<subset>
AND <subset>
OR
+
Example 4
<entity reference declaration>
45 , 7
ENTITY REFERENCE 8<entity ref ID> ( <class ID> ) 8
Example 5
PS MODIFY 0
45 , 7
08<request number>80
D <request number> <request number> D
ALL
EXCEPTIONS
0
D 45 , 7 D
8<file attribute phrase>8
D
<print modifier phrase>
H O
heading, 2-29 OPTIONS command, 3-71
HELP command, 3-68 output control and formatting, 2-26
I P
initiating and running inquiry, A-8 PRINTER command, 3-74
Inquiry commands, summary of, 3-1
Inquiry extract, 2-39
Inquiry files, A-1 Q
Inquiry generation, A-2
Inquiry process, 2-4 qualification, 2-7
Inquiry report, 2-34 QUIT command, 3-77
item and value display, 2-8
item display, combining with record
selection, 2-9 R
items
undefined, 2-18
railroad diagrams, explanation of, B-1
virtual, 2-16
RECALL command, 3-78
record functions, 3-17
record selection, 2-5
J combining with item display, 2-9
REDEFINE command, 3-80
job decks, generation from, A-6 related records across data sets, 2-19
remote generation using the NOZIP
option, A-5
L REPEAT command, 3-82
REPORT command, 3-85
linear searches, avoiding, A-9 required files, A-8
LN function, 2-13 RESTORE command, 3-95
LOG function, 2-13 running and generating Inquiry, A-1
running and initiating Inquiry, A-8
running Inquiry from
M card readers, A-11
terminals, A-10
MAX function, 2-13 run-time diagnostic options, A-10
mean square function, 2-13
MIN function, 2-13
modification of audited databases, 2-25 S
modifying databases, 2-21
MSQ function, 2-13 SAVE command, 3-97
SCALE function, 2-13
SELECT command, 3-19
N SELECT/DISPLAY command, 3-29
selection condition, 2-5, 3-3
natural log function, 2-13 selection record, 2-5
NEXT command, 3-69 SET command, 3-99
NOZIP option, remote generation using, A-5 SHOW command, 3-102
single, 2-31
tab, 2-30
TAN function, 2-13
TERMINAL command, 3-112
terminals, running Inquiry from, A-10
TITLE command, 3-115
*88076120-004*
8807 6120–004