Resources

Home   News   Version 1   Tech Support   Pubs   S2K Site Map



SYSTEM 2000 Quick Reference Guide QUEST Language Commands



ADD

Replaces nulls with values in existing data records.

Syntax

ADD item full-trace EQ |value *  :
                   |PREVIOUS

ADD item full-trace] = |item                   :
                   |* function *
                   |* function (parameters)
                   |(adhoc-function)
                   |system-function

ADD item [partial-trace] EQ |value * where-clause :
                        |PREVIOUS

ADD item [partial-trace] = |item           where-clause :
                       |* function *
                       |* function (parameters)
                       |(adhoc-function)
                       |system-function

ADD record full-trace EQ |value-stream END * :
                     |PREVIOUS

ADD record [partial-trace] EQ |value-stream END * where-clause:
                          |PREVIOUS
item
is a schema item name or component number.

full-trace
is a list of one or more positive integers or 0, each preceded by the system separator (for example, *1*4*0). In a left-to-right scan, each integer designates the position of the child record under its parent at each level. The rightmost integer designates the level 0 position. Zero means last.

value
is a literal value or a system string (*NOW*, *TODAY*, *FTODAY*).

PREVIOUS
repeats the value stream or the item value in the preceding update command.

function
is a stored function name or component number.

parameters
are the values that replace the numbered parameters in the stored function. See Function Definition in DEFINE.

adhoc-function
is a mathematical expression enclosed in parentheses. See Ad Hoc Function.

system-function
allows you to obtain simple arithmetic statistics about values stored in a database. System functions include: AVG, COUNT, MAX, MIN, SIGMA, and SUM. See System Function.

partial-trace
is a trace in which the last integer designates a position other than level 0.

record
is a schema record name or component number.

value-stream
is a series of item numbers and values to be added, with each item number followed by its associated value. The system separator must follow each item number and each value. The item numbers do not have to be in DESCRIBE order.

where-clause
selects specific data records. See Where-Clause.

Examples

AD C412 EQ BS* WH C1 = 1005:

ADD EDUCATION EQ 413*01/07/85*414*ENGLISH*415*MARKETING*END*
   WH C2 EQ BROOKS:

ADD C126 = (C124 - C114) WH C1 EXISTS AND C121 EQ 06/30/91:

ADD C105 = (*TODAY*) WH C2 = GIBSON:

Rules

Back to Top of Page


Ad Hoc Function

Specifies mathematical operations to be performed on data. The following operands are available:

Syntax

*         multiplication

/         division

+         addition

-         subtraction

Examples

PRINT (C114 + C126) WHERE C1 EQ 1010:

PR (((MIN C126) + (MAX C126))/2):

Rules

Back to Top of Page


ASSIGN

Replaces values or nulls with values in existing data records.

Syntax

ASSIGN item full-trace EQ |value *  :
                      |PREVIOUS

ASSIGN item full-trace = |item                    :
                     |* function *
                     |* function (parameters)
                     |(adhoc-function)
                     |system-function

ASSIGN item [partial-trace] EQ |value * where-clause :
                           |PREVIOUS

ASSIGN item [partial-trace] = |item                where-clause :
                          |* function *
                          |* function (parameters)
                          |(adhoc-function)
                          |system-function

ASSIGN record full-trace EQ |value-stream END * :
                        |PREVIOUS

ASSIGN record [partial-trace] EQ |value-stream END * where-clause :
                             |PREVIOUS
item
is a schema item name or component number.

full-trace
is a list of one or more positive integers or 0, each preceded by the system separator (for example, *1*4*0). In a left-to-right scan, each integer designates the position of the child record under its parent at each level. The rightmost integer designates the level 0 position. Zero means last.

value
is a literal value or a system string (*NOW*, *TODAY*, *FTODAY*).

PREVIOUS
repeats the value stream or the item value in the preceding update command.

function
is a stored function name or component number.

parameters
are the values that replace the numbered parameters in the stored function. See Function Definition in DEFINE.

adhoc-function
is a mathematical expression enclosed in parentheses. See Ad Hoc Function.

system-function
allows you to obtain simple arithmetic statistics about values stored in a database. System functions include: AVG, COUNT, MAX, MIN, SIGMA, and SUM. See System Function.

partial-trace
is a trace in which the rightmost integer designates a position other than level 0.

record
is a schema record name or component number.

value-stream
is a series of item numbers and values to be assigned, with each item number followed by its associated value. The system separator must follow each item number and each value. The item numbers do not have to be in DESCRIBE order.

where-clause
selects specific data records. See Where-Clause.

Examples

AS OFFICE-EXTENSION EQ 410 XT369* WH C1 = 1120:

AS C14 EQ 2311 HANSFORD* WH C3 EQ MOLLY I. AND C2 EQ GIBSON:

ASSIGN JOB SKILLS EQ 201*RUSSIAN*202*EXCELLENT*203*15*END*
   WH C2 EQ BOWMAN:

Rules

Back to Top of Page


ASSIGN TREE

Replaces existing data trees (including the data) with new data trees.

Syntax

ASSIGN TREE record full-trace EQ |value-stream END* :
                             |PREVIOUS

ASSIGN TREE record [partial-trace] EQ |value-stream END* where-clause :
                                  |PREVIOUS

record
is a schema record name or component number; the target record.

full-trace
is a list of one or more positive integers or 0, each preceded by the system separator (for example, *1*4*0). In a left-to-right scan, each integer designates the position of the child record under its parent at each level. The rightmost integer designates the level 0 position. Zero means last.

value-stream
is a series of component numbers and associated item values in the same format as for the loader stream. The record number to the left of the EQ operator is not included in the value stream. See LOAD for the format of a loader stream.

PREVIOUS
repeats the value stream or the item value in the preceding update command.

partial-trace
is a trace in which the rightmost integer designates a position other than level 0.

where-clause
selects specific data records. See Where-Clause.

Example

AT C100 EQ 101*PROGRAMMER*102*INFORMATION SYSTEMS*103*MYJ*104*
   PROFESSIONAL*105**TODAY**110*111*1100.00*112*MONTHLY*113*
   *TODAY**114*194.50*120*120*130*131*1.0*132*NEW EMPLOYEE*END*
   WH C1 = 1345:

Rules

Back to Top of Page


By-Clause

Specifies that only certain items within a data tree are to be displayed together in logical order. Enables you to specify which values are to be retrieved, to retrieve data from disjoint records, or to specify computations on subsets of data.

Syntax

by-phrase, units

unit by-phrase
by-phrase
BY |record
   |DATA BASE

unit
|item
|record
|* function *
|* function (parameters)
|* string *
|* string (parameters)
|(adhoc-function)
|system-function
|cf-item

item
is a schema item name or component number.

record
is a schema record name or component number.

function
is a stored function name or component number.

string
is a stored string name or component number.

parameters
are the values that replace the numbered parameters in the stored function. See Function Definition in DEFINE.

adhoc-function
is a mathematical expression enclosed in parentheses. See Ad Hoc Function.

system-function
allows you to obtain simple arithmetic statistics about values stored in a database. System functions include: AVG, COUNT, MAX, MIN, SIGMA, and SUM. See System Function.

cf-item
is a Collect File item name.

Examples

LIST C1, C2, BY C100, C102, C132 WH C7 EQ FEMALE:

LIST C1, C2, BY C100, C102, C132, BY C110, C121 WH C7 = FEMALE:

PRINT BY C0, C102, C201 WH C7 EQ FEMALE:

PRINT COUNT C0, BY DATA BASE, COUNT C0 WHERE C7 = FEMALE:

PRINT C111 BY C0 WHERE SAME:

PRINT BY C0, C111 BY C100 WHERE SAME:

Rules

Back to Top of Page


CHANGE value

Replaces existing values with new values.

Syntax

CHANGE item full-trace EQ |value *  :
                      |PREVIOUS

CHANGE item full-trace = |item                    :
                     |* function *
                     |* function (parameters)
                     |(adhoc-function)
                     |system-function

CHANGE item [partial-trace] EQ |value * where-clause :
                           |PREVIOUS

CHANGE item [partial-trace] = |item                 where-clause :
                          |* function *
                          |* function (parameters)
                          |(adhoc-function)
                          |system-function

CHANGE record full-trace EQ |value-stream END * :
                        |PREVIOUS

CHANGE record [partial-trace] EQ |value-stream END * where-clause :
                             |PREVIOUS
item
is a schema item name or component number.

full-trace
is a list of one or more positive integers or 0, each preceded by the system separator (for example, *1*4*0). In a left-to-right scan, each integer designates the position of the child record under its parent at each level. The rightmost integer designates the level 0 position. Zero means last.

value
is a literal value or a system string (*NOW*, *TODAY*, *FTODAY*).

PREVIOUS
repeats the value stream or the item value in the preceding update command.

function
is a stored function name or component number.

parameters
are the values that replace the numbered parameters in the stored function. See Function Definition in DEFINE.

adhoc-function
is a mathematical expression enclosed in parentheses. See Ad Hoc Function.

system-function
allows you to obtain simple arithmetic statistics about values stored in a database. System functions include: AVG, COUNT, MAX, MIN, SIGMA, and SUM. See System Function.

partial-trace
is a trace in which the rightmost integer designates a position other than level 0.

record
is a schema record name or component number.

value-stream
is a series of values to be changed, each preceded by its associated item number. The system separator must follow each item number and each value. The item numbers do not have to be in DESCRIBE order.

where-clause
selects specific data records. See Where-Clause.

Examples

CH PAY SCHEDULE EQ MONTH*  WH C112 EQ MONTHLY:

CHANGE C11 EQ 80.00* WHERE C1 EQ 1120:

CHANGE C131 = (C131/10) WH C1 = 1043:

CH JOB SKILLS EQ 202*GOOD*203*3*END* WH C201 EQ GRAPHICS AND
   C1 EQ 1043:

CH C0 EQ 14* 1302 LAZY LANE* 16* 78752* END* WH C1 = 1120:

Rules

Back to Top of Page


CLEAR

Specifies when modified database pages, or Update Log pages, or both are to be written from main memory to disk.

Syntax

CLEAR :

[CLEAR] AUTOMATICALLY :

CLEAR UPDATE LOG :

[CLEAR] UPDATE LOG AUTOMATICALLY :

Examples

CLEAR UPDATE LOG AUTO:

CLEAR:

CLEAR UPDATE LOG:

Rules

Back to Top of Page


COLLECT

Creates (or cancels) a Collect File, which is a relational table containing values extracted from one or more databases.

Syntax

COLLECT [/[options] [,TITLE comment]/] retrieval-clause
     [[,ordering-clause] where-clause] :

COLLECT :
options
is a list of one or more of the following format options, separated by commas. Defaults are listed in the first column.
INDENT               BLOCK
NULL SUPPRESS        NULL
NUMBER               NAME
REPEAT               REPEAT SUPPRESS
SINGLE SPACE         DOUBLE SPACE
STUB                 STUB SUPPRESS
TREE                 RECORD
ZERO SUPPRESS        ZERO
HEX OFF              HEX ON
See FORMOP for details on format options.

TITLE
allows you to insert a comment within the output. (If you do not specify format options, do not include a comma before the keyword TITLE.)

comment
can be any string of characters not containing the command terminator or a slash. The comment cannot begin with (, B(, D(, F(, L(, R(, or S(, and it must be less than 130 characters long, although leading, trailing, and extraneous blanks are not counted. The comment is displayed with the echo of the command in the Message File.

retrieval-clause
cf-retrieval-object [,cf-retrieval-object]

cf-retrieval-object
[cf-item = ] retrieval-object

cf-item
is a unique Collect File item name, which can be any character string. If reserved words or component numbers are used, the Collect File cannot be used to create a new database. The Collect File item name can be omitted if it is the same as the retrieval object's name.

retrieval-object
is a schema item name or component number, Collect File item name, stored function, system function, or ad hoc function. You cannot specify a schema record unless it is embedded in a system function.

ordering-clause
specifies the order of selected data records. A where-clause is required if an ordering-clause is specified. See Ordering-Clause.

where-clause
selects specific data records. See Where-Clause.

Examples

COLLECT LAST NAME, HIRE DATE, ACCRUED VACATION:

COLLECT:

CO NAME = LAST NAME, HIRED = HIRE DATE, VACATION = ACCRUED VACATION,
   OB HIRE DATE WH HIRE DATE SPANS 01/01/1988 * 01/01/1989:

Rules

Back to Top of Page


COPY TREE

Duplicates a data record and its descendants from one position in a database to another.

Syntax

COPY TREE record |where-clause               TO |before-clause              :
                |partial-trace where-clause        |after-clause
                |full-trace                     |partial-trace where-clause
                                              |full-trace
record
is the name or component number of the schema record at the top node of the tree to be copied.

where-clause
selects specific data records. See Where-Clause.

partial-trace
is a trace in which the rightmost integer designates a position other than level 0.

full-trace
is a list of one or more positive integers or 0, each preceded by the system separator (for example, *1*4*0). In a left-to-right scan, each integer designates the position of the child record under its parent at each level. The rightmost integer designates the level 0 position. Zero means last.

before-clause
is the same as a where-clause except that the keyword BEFORE replaces the keyword WHERE. See Where-Clause.

after-clause
is the same as a where-clause except that the keyword AFTER replaces the keyword WHERE. See Where-Clause.

Examples

COPY TREE C110 WHERE C113 = 03/01/90 AND C1 = 1120
   TO AFTER C113 EQ 03/01/91 AND C1 EQ 1120:

CT C0*1 TO *3:

Rules

Back to Top of Page


DATE FORMAT IS

Specifies alternate input and output formats for dates.

Syntax

DATE FORMAT IS |MM/DD/YYYY :
               |MM/DD/YY
               |DD/MM/YYYY
               |DD/MM/YY
               |YY/MM/DD
               |YYYY/MM/DD

Example

DATE FORMAT IS MM/DD/YY:

Rules

Back to Top of Page


DESCRIBE

Displays all or part of a database definition.

Syntax

DESCRIBE :

DESCRIBE |[/DEFINE/]             |component [THROUGH component] :
         |[/AUTHORITIES [n]/]    |RECORD unit
         |[/DEFINE,AUTHORITIES/]

DESCRIBE [/DEFINE/] |STRINGS   :
                    |FUNCTIONS

DESCRIBE /COLLECT FILE [,DEFINE]/ [cf-item [(CF)] [THROUGH cf-item [(CF)]]] :
component
is an item, record, string, or function name or component number.

n
is a positive integer indicating the column in which component authorities are to be printed. The number must be between one and the line length, minus three. The default is 68.

unit
is the component name or number of a schema record or schema item for the RECORD option. If you specify an item, the software displays the parent schema record along with its items and subordinate records.

cf-item
is a Collect File item name.

Examples

DESCRIBE:

DESCRIBE /DEFINE/ SECURITY CLEARANCE:

DESC C110:

DESCRIBE /CF/ C13 (CF):

DESCRIBE C400 THRU C415:

DESCRIBE STRINGS:

DESCRIBE FUNCTIONS:

DESCRIBE /AUTHORITIES 45/:

DESCRIBE /AUTH 50/C100 THROUGH C110:

DESCRIBE RECORD C100:

DESCRIBE /AUTH 41/ RECORD C100:

DESCRIBE /DEFINE/ RECORD C100:

DESCRIBE /DEFINE, AUTH/ C0 THRU C10:

Rules

Back to Top of Page


DITTO

Repeats the most recently executed action-clause of a retrieval or update command.

Syntax

DITTO [where-clause] :
where-clause
selects specific data records. See Where-Clause.

Example

PR COUNT ENTRY WH C7 EQ FEMALE AND C124 GE $1000.00 AT 1:
   .
   .
   .
DI WH GENDER EQ MALE AND C124 GE $1000.00 AT 1:

Rules

Back to Top of Page


ENABLE/DISABLE EXECUTION

Allows or prevents the execution of QUEST, DEFINE, or QUEUE retrieval and update commands. However, ENABLE EXECUTION and DISABLE EXECUTION allow scanning of those commands for syntax errors.

Syntax

|ENABLE  EXECUTION :
|DISABLE

Examples

ENABLE EXECUTION:

DISABLE EXECUTION:

Rules

Back to Top of Page


ENABLE/DISABLE VALUES PADDING

Controls the placing of new values of key items in the Distinct Values Table.

Syntax

|ENABLE  VALUES PADDING :
|DISABLE

Example

ENABLE VALUES PADDING:

Rules

Back to Top of Page


FORMOP

Sets format options without your having to issue a PRINT, LIST, UNLOAD, or COLLECT command.

Syntax

FORMOP /options/ :
options
is a list of one or more of the following format options, separated by commas. Defaults are listed in the first column.
INDENT               BLOCK
NULL SUPPRESS        NULL
NUMBER               NAME
REPEAT               REPEAT SUPPRESS
SINGLE SPACE         DOUBLE SPACE
STUB                 STUB SUPPRESS
TREE                 RECORD
ZERO SUPPRESS        ZERO
HEX OFF              HEX ON
The rules pertaining to the format options also apply when you specify format options with the PRINT, LIST, UNLOAD, or COLLECT command.

Example

FORMOP /REPEAT SUPPRESS, DOUBLE SPACE/:

Rules

Back to Top of Page


FRAME and END FRAME

Establishes a logical unit of work for Coordinated Recovery, or places a global hold on the database, or both. If the Rollback Log is enabled, each FRAME and END FRAME command causes a database synchpoint.

Syntax

FRAME [/IMMEDIATE/] :

END FRAME :

Examples

FRAME /IM/:

END FR:

Rules

Back to Top of Page


INSERT TREE

Inserts new data trees where trees do not exist.

Syntax

INSERT TREE record EQ |value-stream END* |before-clause :
                     |PREVIOUS        |after-clause

INSERT TREE record full-trace EQ |value-stream END* :
                             |PREVIOUS

INSERT TREE record partial-trace EQ |value-stream END* where-clause:
                               |PREVIOUS
record
is a schema record name or component number.

value-stream
is a series of component numbers and associated data values in the same format as the loader stream. The record number to the left of the EQ operator is not included in the value stream. See LOAD for the format of a loader stream.

PREVIOUS
repeats the value stream in the preceding update command.

before-clause
is the same as a where-clause, except that the keyword BEFORE replaces the keyword WHERE. See Where-Clause.

after-clause
is the same as a where-clause, except that the keyword AFTER replaces the keyword WHERE. See Where-Clause.

full-trace
is a list of one or more positive integers or 0, each preceded by the system separator (for example, *1*4*0). In a left-to-right scan, each integer designates the position of the child record under its parent at each level. The rightmost integer designates the level 0 position. Zero means last.

partial-trace
is a trace in which the rightmost integer designates a position other than level 0.

where-clause
selects specific data records. See Where-Clause.

Examples

IT C420 EQ 421*422*COBOL*423*09/09/1986*END* AFTER C2 = REID
   AND C421 = TECNIK:

INSERT TREE C120 *1*1*1 EQ 121*06/30/91* END* WH C1 EXISTS:

IT C120 *1*1*1 EQ 121*05/29/91*122*184.00*123*10.00*124*1950.00*
   125*153.20*126*1560.35*END* WHERE C1 EQ 1120:

IT C200 *2 EQ 201*COBOL*202*GOOD*203*1*END* WH C1 = 1120:

IT C0 *0 EQ 100*101*PROGRAMMER*102*INFORMATION SYSTEMS*130*131*
   1.0*132*NEW EMPLOYEE*END*:

Rules

Back to Top of Page


LIMIT and END LIMIT

Does three things: sets a specific number of records on which retrieval or update commands are to be executed, sets a minimum and maximum for the number of records on which retrieval or update commands are to be executed, or controls the output of selected records in retrieval commands.

Syntax

LIMIT k :

LIMIT k , m |[/CANCEL] :
            |[/TRUNCATE]

LIMIT k , m |[/CANCEL] , j [/fileref] :
            |[/TRUNCATE]

END LIMIT :
k, m, j
are positive integers or 0. Zero means infinite for m and j. Also, k and j must be less than or equal to m except when m equals 0. The j intermediate limit has no effect on Collect File commands.

CANCEL

TRUNCATE
controls the output of selected records. The default is CANCEL; that is, if the number of selected records falls outside the range specified, the command is cancelled.

fileref
is a DDname declared in the JCL. The default is the Report File.

END LIMIT
resets the software to the default, which is unlimited.

Examples

LIMIT 3:

LIMIT 3, 5:

LIMIT 3, 3/TRUNCATE:

LIMIT 3, 7, 5:

LIMIT 3, 7, 5/ALTFILE:

LIMIT 3, 7/TRUNCATE, 5:

LIMIT 3, 7/TRUNCATE, 5/ALTFILE:

END LIMIT:

Rules

Back to Top of Page


LIST

Retrieves database and Collect File information and displays it in columnar format.

Syntax

LIST [/[options] {,TITLE specifications]/] retrieval-clause
     [[,ordering-clause] where-clause] :
options
is a list of one or more of the following format options, separated by commas. Defaults are listed in the first column.
INDENT               BLOCK
NULL SUPPRESS        NULL
NUMBER               NAME
REPEAT               REPEAT SUPPRESS
SINGLE SPACE         DOUBLE SPACE
STUB                 STUB SUPPRESS
TREE                 RECORD
ZERO SUPPRESS        ZERO
HEX OFF              HEX ON
See FORMOP for details on format options.

TITLE
allows you to include layout specifications. Use a comma in front of the keyword TITLE only if you have specified a format option. Title and paging specifications can occur anywhere after the keyword TITLE.

specifications
See Layout Specifications.

retrieval-clause
specifies a list of one or more retrieval objects, separated by commas. See Retrieval-Clause.

ordering-clause
specifies the order of selected data records. A where-clause is required if an ordering-clause is specified. See Ordering-Clause.

where-clause
selects specific records. See Where-Clause.

Examples without Layout Specifications

LIST EMPLOYEE NUMBER, LAST NAME WHERE EMPLOYEE NUMBER LE 1005:

LIST C2, C1, C6, ORDERED BY C2 WHERE C1 <= 1003:

LIST LAST NAME, *C2001*, (C106 - C105), AVG C111 WHERE C106 EXISTS:

LIST/DOUBLE SPACE, REPEAT SUP/ C2,C4,C7,C15,C16 WHERE C1 <= 1003:

Layout Specifications

specifications [(page-width)] [title] [paging] [rows]
(page-width)
is the maximum number of characters for a line, 4 to 131. The defaults are 131 for batch and 71 for interactive.

title
D (starting-column) [title-line-text]

paging
F (lines-per-page) [footing-line-text]
Lines-per-page must be from 10 to 60.
rows |L (width) [column-heading] [,S-specification]
     |R
     |B
L
specifies left-justified column heading.

R
specifies right-justified column heading.

B
specifies a blank column; optional heading is left-justified.

Not specifying L, R, or B directs the software to left-justify the heading text and to allow the longest of the three lines possible to determine the width of the columns.

(width)
is the column heading width.

column-heading
[[text] + ] [[text] + ] text

S-specification
tells the software where to start a new row, how to space between rows of column headings, and how to space between corresponding rows of values. For syntax, see LIST command in SYSTEM 2000 QUEST Language and System-Wide Commands, Version 12, First Edition

Examples with Layout Specifications

LIST /TITLE R(16)MAJOR FIELD, L(16)MINOR FIELD/ C414, C415 WHERE
   C415 EXISTS AND C1 LE 1100:

LIST /TITLE (45) D(15) REPORT TITLE, F(15)     --FOOTING LINE--,
   L(10) LAST NAME, EMPLOYEE+NUMBER, R(15) SOCIAL     +SECURITY
   NUMBER/ C2, C1, C6 WHERE C1 =< 1005:

LIST /DOUBLE SPACE, TITLE (40)  D(7)REPORT TITLE,
   F(40)     --FOOTING LINE--,
   L(10) LAST NAME,S(1,2),B(10),
   L(8)EMPLOYEE+ NUMBER,R(15)SOCIAL     +SECURITY NUMBER,S(2)/
   C2, C1, C6 WHERE C1 LE 1005:

LI/TITLE D(20)*NOW*/C1, C2, C3 WH C1 <= 1010:

Rules

Back to Top of Page


LOAD

Loads data into a database in logical order.

Syntax

LOAD :

Example

LOAD:

Rules

Back to Top of Page


MOVE TREE

Moves a data record and its descendants from one position in a database to another without affecting the database tables or index.

Syntax

MOVE TREE record |where-clause               TO |before-clause              :
                |partial-trace where-clause        |after-clause
                |full-trace                     |partial-trace where-clause
                                             |full-trace
record
is a schema record name or component number; the target record.

where-clause
selects specific records. See Where-Clause.

partial-trace
is a trace in which the rightmost integer designates a position other than level 0.

full-trace
is a list of one or more positive integers or 0, each preceded by the system separator (for example, *1*4*0). In a left-to-right scan, each integer designates the position of the child record under its parent at each level. The rightmost integer designates the level 0 position. Zero means last.

before-clause
is the same as a where-clause except that the keyword BEFORE replaces the keyword WHERE. See Where-Clause.

after-clause
is the same as a where-clause except that the keyword AFTER replaces the keyword WHERE. See Where-Clause.

Example

MT C110 WH C113 EQ 03/01/90 AND C1 EQ 1120 TO AFTER C113 = 03/01/91
   AND C1 = 1120:

Rules

Back to Top of Page


Ordering-Clause

Specifies the output order of data to be retrieved with PRINT, LIST, UNLOAD, and COLLECT commands. Can also be used with RELOAD and MAP.

Syntax

,ORDERED BY sort-keys
sort-keys
is a list of one or more items, records, ad hoc functions, stored functions, or system functions in the following format, separated by commas.
|[LOW] unit
|[HIGH]

LOW
specifies low-to-high (ascending) order, for example, A,B,C,D or 1,2,3,4. The default is LOW.

HIGH
specifies high-to-low (descending) order, for example, Z,Y,X,W or 9,8,7,6.

unit
|item
|record
|stored-function
|(adhoc-function)
|system-function

item
is a schema item name or component number.

record
is a schema record name or component number.

stored-function
is a stored function name or component number with optional parameters.

adhoc-function
is a mathematical expression enclosed in parentheses. See Ad Hoc Function.

system-function
allows you to obtain simple arithmetic statistics about values stored in a database. System functions include: AVG, COUNT, MAX, MIN, SIGMA, and SUM. A by-phrase is required if you use a system function in an ordering-clause. See System Function.

Examples

PRINT C1, C2, C10, ORDERED BY C1, C10 WHERE C1 EXISTS:

UNLOAD C1, OB C1 WH C1 EXISTS:

PR C1, C2, C11, OB HIGH C1, LOW C2, HIGH C11 WH C11 EXISTS:

Rules

Back to Top of Page


PRINT

Retrieves database or Collect File information and displays it in a simple, sequential list.

Syntax

PRINT [/[options] [,TITLE comment]/] retrieval-clause
     [[,ordering-clause] where-clause] :
options
is a list of one or more of the following format options, separated by commas. Defaults are listed in the first column.
INDENT               BLOCK
NULL SUPPRESS        NULL
NUMBER               NAME
REPEAT               REPEAT SUPPRESS
SINGLE SPACE         DOUBLE SPACE
STUB                 STUB SUPPRESS
TREE                 RECORD
ZERO SUPPRESS        ZERO
HEX OFF              HEX ON
See FORMOP for details on format options.

TITLE
allows you to insert a comment within the output. (If you do not specify format options, do not include a comma before the keyword TITLE.)

comment
can be any string of characters not containing the command terminator or a slash. The comment cannot begin with (, B(, D(, F(, L(, R(, or S(, and it must be less than 130 characters long, although leading, trailing, and extraneous blanks are not counted. The comment is displayed with the echo of the command in the Message File.

retrieval-clause
specifies a list of one or more retrieval objects, separated by commas. See Retrieval-Clause.

ordering-clause
specifies the order of selected data records. A where-clause is required if an ordering-clause is specified. See Ordering-Clause.

where-clause
selects specific data records. See Where-Clause.

Examples

PRINT C1, C2:

PR C100 WHERE C1 = 1265:

PRINT/DOUBLE SPACE,INDENT/ C2,C4,C7,C15,C16 WHERE C1 LE 1003:

PRINT /TITLE THIS TEXT DISPLAYED IN MESSAGE FILE/ C1, C2, C3:

Rules

Back to Top of Page


QUEUE

Calls the QUEUE processor.

Syntax

QUEUE :

Example

USER, DEMO:
DBN IS EMPLOYEE:
   .
   .  (QUEST commands)
   .
QUEUE:                 (calls QUEUE)
   .
   .
   .

Rules

Back to Top of Page


RELOAD

Reconstructs database files.

Syntax

RELOAD [[ordering-clause] where-clause] :
ordering-clause
specifies the order of selected data records. You can specify only level 0 items. A where-clause is required if an ordering-clause is specified. See Ordering-Clause.

where-clause
selects specific data records. You cannot include the SAME operator. See Where-Clause.

Examples

RELOAD:

RELOAD WHERE EMPLOYEE NUMBER < 5075:

RELOAD ORDERED BY C1 WHERE C1 EXISTS:

Rules

Back to Top of Page


REMOVE

Replaces values with nulls in selected data records.

Syntax

REMOVE item full-trace :

REMOVE item [partial-trace] where-clause :

REMOVE record full-trace :

REMOVE record [partial-trace] where-clause :
item
is a schema item name or component number.

full-trace
is a list of one or more positive integers or 0, each preceded by the system separator (for example, *1*4*0). In a left-to-right scan, each integer designates the position of the child record under its parent at each level. The rightmost integer designates the level 0 position. Zero means last.

partial-trace
is a trace in which the rightmost integer designates a position other than level 0.

where-clause
selects specific data records. See Where-Clause.

record
is a schema record name or component number.

Examples

RE CURRENT DEDUCTION WH C113 EQ 03/01/90 AND C1 EQ 1120:

REMOVE C302 WHERE C1 = 1043:

REMOVE ENTRY WHERE C1 FAILS:

Rules

Back to Top of Page


REMOVE TREE

Removes data trees (including the data) from a database.

Syntax

REMOVE TREE record full-trace :

REMOVE TREE record [partial-trace] where-clause :
record
is a schema record name or component number; the target record.

full-trace
is a list of one or more positive integers or 0, each preceded by the system separator (for example, *1*4*0). In a left-to-right scan, each integer designates the position of the child record under its parent at each level. The rightmost integer designates the level 0 position. Zero means last.

partial-trace
is a trace in which the rightmost integer designates a position other than level 0.

where-clause
selects specific data records. See Where-Clause.

Examples

REMOVE TREE ENTRY WHERE C2 = REID:

RT C130 *2 WHERE C1 EQ 1340:

Rules

Back to Top of Page


REPORT

Calls the REPORT processor.

Syntax

REPORT :

Example

USER, DEMO:
DBN IS EMPLOYEE:
   .
   .  (QUEST commands)
   .
REPORT:                (calls REPORT)
   .
   .
   .

Rules

Back to Top of Page


Retrieval-Clause

Specifies a list of components to be retrieved with a LIST, PRINT, UNLOAD, or COLLECT command. Can include records, items, stored strings, stored functions, ad hoc functions, system functions, by-clauses, and Collect File items -- separated by commas. Can be followed by an ordering-clause, a where-clause, or both.

Syntax

units
unit
|item
|record
|* function *
|* function (parameters)
|* string *
|* string (parameters)
|(adhoc-function)
|system-function
|by-clause
|cf-item

item
is a schema item name or component number.

record
is a schema record name or component number. The record cannot be specified in the retrieval-clause of a LIST command unless it appears in a by-phrase or with the COUNT system function.

function
is a stored function name or component number.

string
is a stored string name or component number.

parameters
are the values that replace the numbered parameters in the stored function or string.

adhoc-function
is a mathematical expression enclosed in parentheses. See Ad Hoc Function.

system-function
allows you to obtain simple arithmetic statistics about values stored in a database. System functions include: AVG, COUNT, MAX, MIN, SIGMA, and SUM. See System Function.

by-clause
specifies that only values for certain items are to be displayed in logical order. See By-Clause.

cf-item
is a Collect File item name. The item name must be followed by (CF) if it has the same name as a schema component.

Examples

PR C1, C2, C3:

PRINT LAST NAME WHERE ACCRUED VACATION EXISTS:

LIST C1, C2, C3, *C2010* WH C1 LE 1010:

PR (C114 + C126) WH C1 EQ 1010:

PR SUM C124 BY C110, SUM C124 BY DATA BASE WH C1 = 1120:

PR MIN C2, MAX C2:

PR C1, (*FTODAY* - C4) WH C1 <= 1004:

Rules

Back to Top of Page


SAME IS

Tells the software which retained list of qualified data records to use when the SAME operator is specified.

Syntax

SAME IS DYNAMIC :

SAME IS STATIC :

Example

SA IS STATIC:

Rules

Back to Top of Page


STOP IF/CONTINUE IF

STOP IF specifies a limit of command errors that can occur before the software ends a session. CONTINUE IF reverses the limit set in a STOP IF command.

Syntax

STOP [AFTER SCAN] IF |[ANY] [UPDATE] |COMMAND IS    REJECTED :
                     |[n]            |COMMANDS ARE

CONTINUE [AFTER SCAN] IF |COMMAND IS    REJECTED :
                         |COMMANDS ARE
ANY
is the default maximum error count, which specifies 1.

n
is the maximum error count. The number must be greater than 0.

UPDATE
If you omit the UPDATE option, all command errors are counted.

Examples

STOP IF 2 COMMANDS ARE REJECTED:

CONTINUE IF COMMANDS ARE REJECTED:

STOP IF ANY COMMAND IS REJECTED:

STOP IF 2 UPDATE COMMANDS ARE REJECTED:

STOP AFTER SCAN IF 9 COMMANDS ARE REJECTED:

Rules

Back to Top of Page


System Function

Obtains simple statistics about database values.

Syntax

|AVG   unit [by-phrase]
|COUNT
|MAX
|MIN
|SIGMA
|SUM
unit
|item
|record
|stored-function
|(adhoc-function)
|cf-item
|(system-function)

item
is a schema item name or component number.

record
is a schema record name or component number.

stored-function
is a stored function name or component number with optional parameters.

adhoc-function
is a mathematical expression enclosed in parentheses. See Ad Hoc Function.

cf-item
is a Collect File item name.

by-phrase
BY |record
   |DATA BASE
See By-Clause .

system-function
You can have one system function inside another. The inner system function must be enclosed in parentheses.

Examples

PRINT MIN C2, MAX C2:

PR COUNT C126, MIN C126, MAX C126, SUM C126, AVG C126, SIGMA C126:

PR SUM C124 BY C0 WH C1 LE 1010:

PR AVG (SUM C124 BY C0):

PR (((MIN C126) + (MAX C126))/2):

Rules

Back to Top of Page


System String

Provides the current date in date and function format and the current time according to your computer's internal calendar and clock.

Syntax

*NOW*            current time

*TODAY*          current date

*FTODAY*         current date in function format

Examples

PRINT C1, (*FTODAY* - C4) WHERE C1 LE 1004:

LIST/TITLE D(20) *NOW*/ C1, C2, C3 WH C1 <= 1010:

Rules

Back to Top of Page


TALLY

Provides summary information about the values stored for key items in a database.

Syntax

TALLY |[/EACH/] items :
      |[/ALL/]
items
is a list of one or more key item names or component numbers, separated by commas. The maximum is 96 items.

Examples

TA /EACH/ C8:

TALLY C7, C8, C9, C102:

Rules

Back to Top of Page


UNLOAD

Retrieves data in a format suitable for use in a Data File.

Syntax

UNLOAD :

UNLOAD [/[options] [,TITLE comment]/] retrieval-clause
     [[,ordering-clause] where-clause] :

UNLOAD/COLLECT FILE [,options] [,TITLE comment]/ :
options
is a list of one or more of the following format options, separated by commas. Defaults are listed in the first column.
INDENT               BLOCK
NULL SUPPRESS        NULL
NUMBER               NAME
REPEAT               REPEAT SUPPRESS
SINGLE SPACE         DOUBLE SPACE
STUB                 STUB SUPPRESS
TREE                 RECORD
ZERO SUPPRESS        ZERO
HEX OFF              HEX ON
See FORMOP for details on format options.

TITLE
allows you to insert a comment within the output. (If you do not specify format options, do not include a comma before the keyword TITLE.)

comment
can be any string of characters not containing the command terminator or a slash. The comment cannot begin with (, B(, D(, F(, L(, R(, or S(, and it must be less than 130 characters long, although leading, trailing, and extraneous blanks are not counted. The comment is displayed with the echo of the command in the Message File.

retrieval-clause
specifies a list of retrieval objects, separated by commas. See Retrieval-Clause.

ordering-clause
specifies the order of selected data records. A where-clause is required if an ordering-clause is specified. See Ordering-Clause.

where-clause
selects specific data records. See Where-Clause.

Examples

UNLOAD:

UN C1, C2:

UNLOAD C100 WH C1 = 1265:

UNLOAD C1, C2, JOB SKILLS WH C1 EQ 1120:

UNLOAD /RECORD/ C100 WH C1 = 1265:

UN C1, C2, SUM C126, (C124 - C114) WH C1 EQ 1265:

UNLOAD /CF/:

Rules

Back to Top of Page


Where-Clause

Selects a subset of a database for retrieval or update commands. A where-clause consists of one or more expressions following the keyword WHERE. Each expression is made up of one or more conditions that an item value must meet.

Syntax

WHERE expression
expression
|condition
|(expression)
|NOT expression
|expression AND expression
|expression OR expression
|record HAS expression
|expression AT n
|SAME

condition
[NON-KEY] item |unary-operator
               |binary-operator value
               |ternary-operator value * value
               |CONTAINS text
               |* binary-operator item *
               |* binary-operator cf-item [(CF)] *
               |IN (value, value [, value])
               |CTNSIN (value, value [, value])

NOT
finds the complement of specified criteria.

AND
combines two expressions by finding data records that satisfy both expressions.

OR
combines two expressions by finding data records that satisfy either expression or both.

record
is a schema record name or component number.

HAS
specifies a focal record to qualify data records based on the contents of descendant or ancestor data records.

AT
specifies a data record by its position under its parent.

n
is a 0 or a positive integer indicating position. Zero means last position.

SAME
repeats the where-clause of a previous command with or without additional qualification criteria.

item
is a schema item name or component number. The item can be key or non-key.

unary-operator
EXISTS or FAILS verifies existence or nonexistence of values for an item.

binary-operator
EQ, NE, GE, GT, LE, or LT

ternary-operator
EQ, NE, or SPANS compares data values with a range of values.

value
is a literal value or a system string (*NOW*, *TODAY*, *FTODAY*). Enclose the value with a delimiter of your choice. The default is the slash. Ternary operators require a low value and a high value.

CONTAINS
searches for characters within an item's value.

text
uses the following syntax:
[[THE] CHARACTERS] substring
   [* substring [correlation]] |[position]
                          |[interval]

[THE] |WORD   substring  |[position]
      |PREFIX          |[interval]
      |SUFFIX
For details on searching for characters using CONTAINS, see SYSTEM 2000 QUEST Language and System-Wide Commands, Version 12, First Edition

cf-item
is a Collect File item name. The item name may be followed by (CF) to resolve a conflict between a schema item name and a Collect File item name.

IN
causes the software to create a condition for each specified value. The conditions are connected with the OR operator. Each condition contains the specified item, the EQ operator, and one of the specified values.

CTNSIN
causes the software to create a condition for each specified value. The conditions are connected with the OR operator. Each condition contains the specified item, the CONTAINS operator, and one of the specified values. The software searches for the characters within the item's value.

Examples

PRINT LAST NAME WHERE ACCRUED VACATION EXISTS:

PR LAST NAME WH EMPLOYEE STATUS NE FULL TIME OR EMPLOYEE
   STATUS FAILS:

LI C2, C3 WH C13 FAILS AND C4 GE 01/01/91:

PR C2 WH HIRE DATE SPANS 01/01/88*12/31/1990:

PR C2 WH (MAJOR FIELD = MATH OR MINOR FIELD = MATH)
   AND GENDER EQ FEMALE:

PR C2 WH C0 HAS C201 EQ FORTRAN AND C0 HAS C201 EQ COBOL:

PR C101 WH START DATE* = HIRE DATE*:

LIST C102, C103 WHERE C102 EXISTS AT 1:

AS C14 EQ 2311 HANSFORD* WH C411 EQ /COLLEGE OF WILLIAM AND MARY/:

LI BY ENTRY, C1, C2, C3, C101, C102, C7, C111, OB C2 WH C413
   GT 06/01/1986 AND (C412 IN (MA, MBA, MS, PHD)).

LI C1, C2, C3 WH LAST NAME CONTAINS MAC:

LI C2, C3, C10, OB C2 WH C10 CONTAINS THE CHARACTERS 100*199 WITH
   MATCH ON 3 CHARACTERS FROM POSITION 7 THRU LAST :

PR C1, C2 WH LAST NAME IN (SMITH, JONES):

PR C1, C2 WH LAST NAME CTNSIN (MC, SON, TON):

Rules

Back to Top of Page