QUERY



QUERY

     Start the TurboIMAGE/3000 Database inquiry facility.

SYNTAX

     QUERY

QUERY command set

add             Adds data entries to the data base
alter Edits procedures in the proc-file
assign Sets value of query control options

close Closes a data base opened with the multidb command
comment Allows comments to be added to xeq files and procedure files
create Stores procedures in the proc-file

data-base Specifies the primary data base
data-sets Specifies data sets for the primary data base
dblist Indicates which data bases to access for
multiple data set retrieval and reporting
define Lists the current state of the environment commands for the
primary data base and prompts for changes
delete Removes data entries from the data base
destroy Deletes procedures from the proc-file
display Displays procedures in the proc-file

exit Terminates query execution

find / find all Locates data entries in the data base
form Displays the structure of the data base

help Lists a description of the query command set

join Enables multiple data set retrieval

language Specifies output language for report and list
list Prints data set item values
listredo Displays 20 most recent commands in command history buffer

mode Specifies access mode for the primary data base
multidb Opens additional data bases and modifies their
environment specifications
multifind Retrieves compound entries from a compound data
multifind all set specified by the join command

output Specifies output device

password Specifies access password for the primary data base
proc-file Specifies procedure file

redo Displays the previous command for editing and executes the edited command
release Removes all locks set by the setlocks command
rename Changes Procedure Names in the proc-file
replace Modifies data item values in data entries
report Reports the entries located by the find command
report all

save Allows data entries from the select file to be saved
setlocks Prevents automatic unlocking of a data set
show Displays value of query control options
subset Retrieves entries from a select file

terse Disables verbose messages
transbegin Marks the beginning of a logging transaction
transend Marks the end of a logging transaction
transmemo Writes a message to the log file

undo Restores the previous select file
update add Adds data entries to the data base
update delete Removes data entries from the data base
update replace Modifies data item values in data entries

verbose Enables verbose messages
version Displays version, update, and fix information

xeq Reads and executes command file

For more information enter HELP HELP or HELP command name.

ADD Function

   To add data entries to a manual master or detail data set.

Format

ADD DataSetName

Parameters

DataSetName Name of a data set.

ALTER Function

   To insert, replace or delete lines of a procedure stored in the current proc-file.

Format

A[LTER] ProcedureName

[InsertStatement |
DeleteStatement |
ReplaceStatement]

EndStatement

Parameters

ProcedureName Name of a find, report or update command stored as a
procedure in the proc-file.

InsertStatement
/I,m The lines which follow the insert statement
are inserted into the procedure following line number m.

ReplaceStatement
/R,m[,n] The replace statement deletes the line or
range of lines specified and replaces them
with the lines following the replace statement.

DeleteStatement
/D,m[,n] The delete statement deletes the line or range of lines specified.

EndStatement
/E The end statement terminates the alter command.

Example
>ALTER FIND1
>>/I,1
>>STOCK# IS "" AND
>>LASTSHIPDATE IS ""
>>/E

>ALTER UPDATE1
>>/R,2,3
HOURS="";
DATE="851022";
>>HOURS="14";
>>DATE="851101";
>>STATUS="OK";

>ALTER REPORT4
>>/D,4,5
S2,ORDERDATE
S,LASTSHIPDATE
>>/E

ASSIGN Function

   Assign values to query control options.

Format

AS[SIGN] [DataBaseName:] LOCKOPTION = ON | OFF

Parameters

DataBaseName A data base that is currently open.

ON Enables the lock option. the default is ON.

OFF Disables the lock option.

CLOSE Function

   To close a data base which was opened with the multidb command.

Format

CL[OSE] DataBaseName

Parameters

DataBaseName Name of a data base which was opened with the multidb command.

COMMENT Function

   Allows comments to be added to XEQ files and procedure files.

Format

C[OMMENT] [text]

Parameters

text A string up to 698 characters.

CREATE Function

   To store find, report, or update commands as named procedures in the proc-file.

Format

CREATE SPACE

CREATE ProcedureName,FileName

CREATE ProcedureName,

[FindCommand |
ReportCommand |
UpdateCommand]

END

Parameters

ProcedureName Is an alphnumeric character string from one to eight
characters, starting with an alphabetic.

FileName Name of a MPE ascii file containing a find, report,
 or update command to be stored as a procedure.

SPACE Reports the number of unused records in the proc-file.

Examples
>CREATE FINDNAME, FIND LAST-NAME IS "","","" END
>FIND FINDNAME
WHAT IS THE VALUE OF - LAST-NAME
>>MURTZ
WHAT IS THE VALUE OF - LAST-NAME
>>FRANZONI
WHAT IS THE VALUE OF - LAST-NAME
>>X
USING SERIAL READ
2 ENTRIES QUALIFIED

DATA-BASE Function

   Specify the primary data base.

Format

[DATA-]B[ASE] = DataBaseName

Parameters

DataBaseName Name of a TurboIMAGE data base.
Password =>> Request for password.
Mode =>> Request for access mode.

Example

User 1
>DATA-BASE=ORDERS
PASSWORD = >>BUYER
MODE = >>1

User 2
>B=ORDERS
PASSWORD = >>CLERK
MODE = >>6
DATA BASE OPEN IN ANOTHER MODE

>B=ORDERS
PASSWORD = >>CLERK
MODE = >>5
>

DATA-SETS Function

   To inform query which data set from the primary data base
will be accessed in the event that a data itemName which
appears in more than one data set is used in a command

Format

[DATA-SET]S = DataSetList

Parameters

DataSetList List of DataSetNames each separated by a comma.

Examples
>S=INVENTORY

DBLIST Function

   Indicates which data bases to access for multiple data set
retrieval and reporting.

Format

DBLIST = [DataBaseList]

Parameters

DataBaseList List of DataBaseNames each seperated by a comma.

Example
This example illustrates how QUERY uses the data base list, clears it,
 and enters data base names automatically.

>SHOW DBLIST
ALBUMS
>JOIN JAZZ.ARTIST TO TAPES:JAZZ.ARTIST
>MULTIFIND JAZZ.LABEL="MMM"
USING SERIAL READ
2 COMPOUND ENTRIES QUALIFIED
>DBLIST=
>REPORT
>>OUT=LP
>>D1,JAZZ.LABEL,30
JAZZ IS A MEMBER OF THESE DATA BASES:
ALBUMS,TAPES
WHICH DATA BASE DO YOU WISH TO USE?
>>TAPES
>>END
>SHOW DBLIST
TAPES
>MULTIFIND JAZZ.YEAR=70
USING SERIAL READ
3 COMPOUND ENTRIES QUALIFIED

DEFINE Function

   To list the status of all of the environment comands for the primary
data base and prompts for changes.

Format

DEF[INE]

Parameters

-

Example
>DEFINE
DATA-BASE = >>ORDERS
PASSWORD = >>CLERK
MODE = >>5
DATA-SETS = >>RETURN
PROC-FILE = >>MANPROC
OUTPUT = TERM
OUTPUT = >>RETURN

DELETE Function

   To delete data entries from a data set.

Format

DELETE

Parameters

-

DESTROY Function


To delete a procedure from the current proc-file.

Format

DE[STROY] ProcedureName

Parameters

ProcedureName Name of a find, report or update command stored as a
procedure in the proc-file.

Example
>PROC-FILE =MANPROC
>DISPLAY LIST

FIND1 FIND2 UPD1 UPD2 REP4 REP5
>DESTROY UPD2
>D LIST

FIND1 FIND2 UPD1 REP4 REP5
>

DISPLAY Function

   To list the names of all the procedures or an individual procedure
 stored in the proc-file.

Format

D[ISPLAY] LIST

D[ISPLAY] ProcedureName [,m[,n]]

D[ISPLAY] ProcedureName,FileName

Parameters

LIST Prints the names of all procedures currently in the proc-file.

ProcedureName Name of a find, report or update command stored as a
procedure in the proc-file.

FileName Name of a MPE ascii file.

m and n Are the first and last lines (respectively) of the procedure
 to be displayed.

Example 1
>DISPLAY FIND1,FINDSET
>DISPLAY FIND1

PROCEDURE: FIND1

001 FIND
002 CUSTOMER.ACCOUNT IS ""
003 END

Example 2
>PROC-FILE=MANPROC
>OUTPUT=LP
>DISPLAY LIST

FIND1 FIND2 UPD1 UPD2 REP4 REP5

EXIT Function

   To terminate query execution and return control to the operating system.

Format

E[XIT]

Parameters

-

FIND Function

   To locate entries from a data base which match user criteria.

Format

F[IND] [#LIMIT=i;]
relation / ItemIdentifier [NO] M[ATCHING] "pattern"
[AND/OR relation / ItemIdentifier [NO] M[ATCHING] "pattern"]...
[END]

F[IND] CHAIN MasterSetName.MasterSearchItem, DetailSetName.DetailSearchItem
IS / IE "value"
[AND / OR
MasterSetName.MasterSearchItem, DetailSetName.DetailSearchItem
IS / IE "value" ...]
END

F[IND] ProcedureName [,character]

F[IND] [DataBaseName:] DataSetName.#RecordNumber

Parameters

i An integer specifying the maximum number of entries to be retrieved.

relation [DataBaseName:] [DataSetName.]DataItemName [(subscript)]
relop "value"[,"value"....]

ItemIdentifier [DataBaseName:] [DataSetName.]DataItemName [(subscript)]

DataBaseName Name of a data base.

DataSetName Name of a data set.

DataUtemName Name of a data item.

subscript An integer designating which sub-item to use. if omitted
 then query uses the first sub-item.

relop Is a relational operator:
IS / IE / EQ / = / ISNOT / INE / NE / # / <> / ilt / lt / < /
INLT / GE / >= / IGT / GT / > / INGT / LE / <= / IB

value Is a data item value. It must be the same type and within
the same value range as the data item named in the relation.
 Value need not be enclosed in quote marks (") unless the
value contains special characters.

MasterSetName Name of a master data set.

MasterSearchItem Name of a data item defined as the search item for the master data set.

DetailSetName Name of a detail data set that is related to the master data set
previously named.

DetailSearchItem Name of a data item defined as a search item for the detail data set.

ProcedureName Name of a find command stored in the current proc-file.

character Is any printing ascii character.

pattern A mask specifying the form data retrieved must take.
 Pattern must be enclosed in quote marks.

A pattern consists of a series of the following special
 characters that indicate the type of data that can be
entered in that position:

 text
a upper or lowercase alphabetic character (A-Z, a-z)
u uppercase alphabetic character (A-Z)
l lowercase alphabetic character (a-z)
b blank
d digit (0-9)
? any character

Matching pattern operators/functions.
! transparency
, choice
: range
{ } grouping
[ ] optional
+ repetition (1 or more)
* repetition (0 or more)

RecordNumber A numeric value specifying the RecordNumber in decimal
or %octal or $hexadecimal.

MATCHING Allows you to retrieve data based on the comparison of data item
values with a specified pattern.

NO MATCHING Allows you to retrieve data based on all data records
 NOT MATCHING the pattern provided.
The NO may be followed by additional characters such that
 all of the following examples are accepted:

FIND PRODUCTS.NAME NO MATCH "ABC?*"
FIND PRODUCTS.NAME NOT MATCHING "ABC?*"
FIND PRODUCTS.NAME NONE M "ABC?*

FIND ALL Function

Locates all entries in the data set regardless of the value of the data item specified.
Format
   F[IND] ALL [#LIMIT=i;] ItemIdentifier
<>Parameters
<>
<>   i                An integer specifying the maximum number of entries to be retrieved.

ItemIdentifier [DataBaseName:] [DataSetName.]DataItemName [(subscript)]

Example
>F ALL CUSTOMER.ACCOUNT
USING SERIAL READ
13 ENTRIES QUALIFIED
>R D,ACCOUNT,8;END


54283540
54283545
10293847
.
.
.

24536173
24566356
10034765
>FIND ALL LAST-NAME
USING SERIAL READ
13 ENTRIES QUALIFIED

FORM Function

   To list information about the data bases being accessed.

Format

FO[RM] [DataBaseName[:] / ALL]
[DataSetName | DataItemName | SETS | ITEMS | INDEXES | PATHS]

Parameters

DataBaseName Name of a data base

ALL Specifies that information should be displayed for all open data bases.
If left off then information will only be displayed for the primary
 data base.

DataSetName Name of a data set.

DataItemName Name of a data item.

SETS Lists all data sets.

ITEMS Lists all data items.

INDEXES Lists all third-party index items.

PATHS Lists relationship between data sets.

HELP Function

   To list information about the function, format and parameters of QUERY/3000 commands.

Format

H[ELP] [CommandName [FU[NCTION]] [FO[RMAT]] [PA[RAMETERS]]]

Format interpretation

1. choices are indicated by slash (/)
2. optional parameters indicated by brackets ([...])

Parameters

CommandName Name of query command.

FUNCTION Display function.

FORMAT Display format.

PARAMETERS Display parameters.

Example

>HELP OUTPUT PA FO

PARAMETERS -
TERM - INDICATES THAT OUTPUT SHOULD BE SENT
TO THE DEVICE SPECIFIED AS $STDLIST
LP - INDICATES THAT OUTPUT SHOULD BE SENT
TO THE FORMAL FILE DESIGNATOR 'QSLIST'

FORMAT -
OUTPUT= TERM/LP

JOIN Function

   To enable multiple data set retrieval by specifying the data sets to be
 included in the compound data set, as well specifying the equated data items
 for each pair of data sets.

Format

J[OIN] DataItemEquivalence [,DataItemEquivalence ...]
[;DataSetEquivalence [,DataSetEquivalence ...] ]
[END]

J[OIN] ProcedureName [,character]

Parameters

DataItemEquivalence [DataBaseName:] DataSetName.DataItemName[(subscript)]
 [@] TO [@]
[DataBaseName:] DataSetName.DataItemName[(subscript)]

DataBaseName Name of a data base.

DataSetName Name of a data set.

DataItemName Name of a data item.

subscript Integer which indicates which sub-item to use.
 If omitted then query uses the first sub-item.

@ Specifies that all data item values in one of the
 data sets named in a data item equivalence should
 be included when the data sets are joined, even if a
corresponding data item value for the equated data item
 does not exist in the second data set. There may only be
 one @ per data item equivalence.

DataSetEquivalence DummyDataSetName = DataSetName

DummyDataSetName A temporary DataSetName that the data set on the right
 may be called during multiple data set retrieval and reporting.

ProcedureName Name of a join command stored in the current proc-file.

character Is any printing ascii character.

Example

>JOIN SETA.ITEM1 @ TO SETB.ITEM2,&
>> SETB.ITEM3 @ TO SETC.ITEM2,&
>> SETB.ITEM4 @ TO SETD.ITEM1,&
>> SETD.ITEM2 @ TO SETE.ITEM3

LANGUAGE Function

   To specify output language for report and list.

Format

LANGUAGE=mnemonic

Parameters

mnemonic Language number or language name.

Example
>LANGUAGE=SPANISH

>LA=12

LIST Function

   Print complete or partial entries from a single data set.

Format

L[IST] [DataBaseName:] DataSetName/DataItemList
[FOR relation [and/or relation...] ]
[END]

Parameters

DataBaseName Name of a data base.

DataSetName Name of a data set.

DataItemList DataItemName [(subscript)][, DataItemName [(subscript)]...]

DataItemName Name of a DataItem.

subscript An integer specifying which sub-item to use.
 If omitted then query uses the first sub-item.

relation [DataSetName.] DataItemName [(subscript)] relop "value"[,"value"....]

relop Is a relational operator:
IS / IE / EQ / = / ISNOT / INE / NE / # / <> / ILT / LT / < /
INLT / GE / >= / IGT / GT / > / INGT / LE / <= / IB

value Is a data item value. It must be the same type and within the
 same value range as the data item named in the relation.
 Value need not be enclosed in quote marks (") unless the
value contains special characters.

Example 3
>L SALES FOR STOCK#=6650D22S

LISTREDO Function

   Displays the 20 most recent commands in the command history buffer.

Format

LISTR[EDO] [ m ][ ,n ][ ;ABS | ;REL | ;UNN ]

Parameters

m,n Is a command range either absolute or relative.

ABS Is the default option. It shows absolute command numbers based
 on the order they are entered.

REL Display the commands number in relative sequence.

UNN Suppresses all numbering for commands display.

Example
>LISTREDO
1) DEFINE
2) FIND FINDX
3) LISTREDO
>LISTREDO ;REL
-4) DEFINE
-3) FIND FINDX
-2) LISTREDO
-1) LISTREDO ;REL
>LISTREDO -3 ;REL
-3) LISTREDO
-2) LISTREDO ;REL
-1) LISTREDO -3 ;REL

MODE Function

   To change data base access mode for the primary data base.

Format

M[ODE] = AccessMode

Parameters

AccessMode Integer 1 to 8.

Example
>MODE=3

MULTIDB Function

   Used to open data bases in addition to the primary data base and modify
 their environment specifications.

Format

MULTID[B[ [DataBaseName]

Parameters

DataBaseName Name of a TurboIMAGE data base.

Example
>MULTIDB
DATA-BASE = SECOND
DATA-BASE = >>RETURN
PASSWORD = ********
PASSWORD = >>RETURN
MODE = 1
MODE = >>2
DATA-SETS = SALES,INVENTORY
DATA-SETS = >>RETURN

DATA-BASE = >>THIRD
PASSWORD = >>MGR
MODE = >>6
DATA-SETS = >>CUSTOMER

DATA-BASE = >>//

MULTIFIND Function

   To retrieve compound entries from the compound data set,
the form of which was specified by the join command.

Format

MU[LTIFIND] [#LIMIT=i;]
relation/ItemIdentifier [NO] M[ATCHING] "pattern"
[AND/OR relation/ItemIdentifier [NO] M[ATCHING] "pattern"]...
[END]

MU[LTIFIND] ProcedureName [,character]

Parameters

i An integer specifying the maximum number of entries to be retrieved.

relation [DataBaseName:] [DataSetName./
DummyDataSetName.] DataItemName [(subscript)]
relop "value"/$MISSING [,"value"/$MISSING....]

ItemIdentifier [DataBaseName:] [DataSetName./
DummyDataSetName.] DataItemName [(subscript)]

DataBaseName Name of a data base.

DataSetName Name of a data set.

DummyDataSetName A temporary DataSetName established by the join command.

DataItemName Name of a data item.

subscript Integer designating which sub-item to use.
If omitted then query uses the first sub-item.

relop Is a relational operator:
IS / IE / EQ / = / ISNOT / INE / NE / # / <> / ILT / LT / < /
INLT / GE / >= / IGT / GT / > / INGT / LE / <= / IB

value Is a data item value. It must be the same type and within the
 same value range as the data item named in the relation.
Value need not be enclosed in quote marks (") unless the
value contains special characters.

$MISSING Used to retrieve a missing (non-compound entry) from a compound
data set

ProcedureName Name of a multifind command stored in the current proc-file.

character Is any printing ascii character.
If character is included in the command, then the MULTIFIND
 procedure is printed on the standard list device before it
 is executed.

pattern A mask specifying the form data retrieved must take.
 Pattern must be enclosed in quote marks.
Refer to the FIND command for further specifications.

MATCHING Allows you to retrieve data based on the comparison of data
items with a specified "pattern".

NO MATCHING Allows you to retrieve data based on all data records
 NOT MATCHING the pattern provided.

The NO may be followed by additional characters such that all
of the following examples are accepted:

FIND PRODUCTS.NAME NO MATCH "ABC?*"
FIND PRODUCTS.NAME NOT MATCHING "ABC?*"
FIND PRODUCTS.NAME NONE M "ABC?*"

Example

>JOIN SALES-DETAIL.STOCK# TO STOCK-DETAIL.STOCK#,&
>> STOCK-DETAIL.STOCK# TO MANUF-DETAIL.STOCK#
>MULTIFIND QUAN > 80 AND ON-HAND > 500

MULTIFIND ALL

   Retrieves all compound entries from a compound data set specified by the
most recent JOIN command.

Format

MU[LTIFIND] ALL [#LIMIT=i;]
[ [DataBaseName:] [DataSetName.DummyDataSetName.] DataItemName]

Parameters

i Is an integer specifying the maximum number of qualifying entries you
 want to retrieve. i must be >= 0. If you specify a negative number,
 QUERY ignores your input. When the #LIMIT = parameter is specified,
 only the first i qualifying entries are placed in the select file.
If fewer than i qualifying entries exist, then all entries that qualify
are put in the select file.

DataBaseName Is the name of a data base specified in either the DEFINE,
  DATA-BASE=, or MULTIDB command, and named in the most recent
JOIN command.

DataSetName Use the name of a data set used in the most recent JOIN command.
  If data base name is specified, the data set must belong to that
 data base.

DummyDataSetName Is a temporary data set name established in the most recent
 JOIN command.

DataItemName Is a data item belonging to one of the data sets named on the
 most recent JOIN command. If data set name is specified, the
 data item must belong to that data set.

Example

>JOIN SALES-DETAIL.STOCK# TO&
>> INVENTORY-DETAIL.STOCK#
>MULTIFIND ALL SALES-DETAIL.STOCK#
USING SERIAL READ
2 COMPOUND ENTRIES QUALIFIED

OUTPUT Function

   To direct output to a device other than the normal output device.

Format

O[UTPUT] = TERM | LP

Parameters

TERM Indicates that output should be sent to the device specified as $STDLIST.

LP Indicates that output should be sent to the formal file designator QSLIST.

Example
>OUTPUT=LP
>O=TERM

PASSWORD Function

   To change the data base access password for the primary data base.

Format

PA[SSWORD] = AccessWord

Parameters

AccessWord Password assigned by data base administrator.

Example

>PA=CLERK

PROC-FILE Function

   To specify the name of the file used to store commands created as procedures.

Format

P[ROC-FILE] = FileName [,n]

Parameters

FileName Name of a MPE ascii file.

n File size (5<= n <= 400). Default = 126.

Example

>PROC-FILE =MANPROC

REDO Function

   Displays the selected command for editing and executes the edited command.

Format

RED[O] [ m | -n | string ] [options]

Parameters

m Command number m in the command history buffer.

-n The nth command before the most recent one.

string The most recent command beginning with the string.

options b|s : Breaks the line being edited into two lines.

d : Deletes the character above the d.

h : Lists all the valid editing subcommands.

i : Inserts one or more characters preceding the character above the i.

l : Lists the complete command as it is currently edited.

r : Replaces one or more characters beginning with the character above the r.

c|u|/ : Undoes all the changes to the curret line and resets the line to the
 original form.

x : Executes the edited version of the command.

+[n] : Makes the nth line forward in the command being edited available for editing.

-[n] : Makes the nth line backward in the command eing edited available for editing.

<return> : Makes the next line of the command being edited available for editing.

Example

>LISTREDO -3

RELEASE Function

   To specify that any locks currently being held should be removed.

Format

REL[EASE]

Parameters

-

RENAME Function

  Changes a procedure name in the proc-file.

Format

RENAME OldName,NewName

Parameters

OldName Current Procedure Name.

NewName New Procedure Name.

Example

>RENAME UPCUST,UPACCT

REPLACE Function

   To modify the values of data items.

Format

REPLACE,DataItemName [(subscript)] = "value";
[DataItemName [(subscript)] = "value";]
.
.
.
[DataItemName [(subscript)] = "value";]
END

Parameters

DataitemName Name of a data item contained in the entries located
by the FIND command.

subscript An integer which indicates which sub-item to use.
 If omitted then query uses the first sub-item.

value New value for the data item.

REPORT function

   To list data item values of entries located by a retrieval command.

Format

R[EPORT] [OutputControlStatements;] ALL[,character]

R[EPORT] ReportBody END

R[EPORT] ProcedureName [,character]

Parameters

character Is any printing ascii character

ReportBody Consists of header, detail, register,
sort, group, total and edit statements.

ProcedureName Name of a report command stored in the current proc-file.

header Prints title, column headings, page numbers, time of day,
 and the date at the top of each report page.

detail Prints data item values in the column position specified.

sort Sorts data entries based upon the value of a specified data item.

group Prints a data item value or character string whenever the value of an
appropriate "sort item" changes.

total Prints column count, average, or totals for logical groups or entire report.

edit Describes Edit Masks.

register Identifies a register and specifies an operation to be performed.

header H HeaderNumber,PrintElement,PrintPosition
[,SPACE A[number]] [,SPACE B[number]]
[,EditOption]

PrintElement 1.[DataBaseName:][DataSetName.DummyDataSetName.]DataItemName[(subscript)]

2.Is characters enclosed in quotation marks. The characters are stripped
of the surrounding quotation marks and printed.

3.Is PAGENO, DATE, or TIME.
PAGENO Consecutively numbers each page of the report.
DATE Prints the date in the form: MM/DD/YY.
 The date is eight characters in length for all
 languages except Canadian-French which uses a
ten character CCYY-MM-DD format.
TIME Prints the time in the form: HH:MM:SS.

detail D [DetailNumber],PrintElement,PrintPosition
[,SPACE A[number]] [,SPACE B[number]]
[,SKIP A/B]
[,EditOption]

PrintElement 1:[DataBaseName:][DataSetName.DummyDataSetName.]DataItemName[(subscript)]

2:Is the contents of a register (Rn). If a register is specified, the
 data in the register is printed. You must enter both the letter and
 the number. Refer to REPORT Register Statement for more information.

3:Is a series of characters enclosed in quotation marks.
The characters are printed without the surrounding quotation marks,
 and are printed once for each entry reported.

register R number,{[L]OAD |
[A]DD |
[S]UB |
[M]ULT |
[D]IV },DataElement
[,NOREPEAT]

DataElement 1:[DataBaseName:][DataSetName.DummyDataSetName.]DataItemName[(subscript)]

2:Is the contents of a register (Rn).

3:Is a number enclosed in quotation marks (a numeric literal).
 You must specify the quotation marks, but QUERY will strip them
and use the number in the operation.

sort S [level],DataItem [,ASC/DES]

ASC Indicates that the data item values are to be ordered in
ascending order. If you do not specify ASC or DES, the
default order is ASC.

DES Indicates that the data item values are to be ordered in
 descending order.

group G level,PrintElement,PrintPosition
[,SPACE A[number]] [,SPACE B[number]]
[,SKIP A/B]
[,EditOption]

PrintElement 1:[DataBaseName:][DataSetName.DummyDataSetName.]DataItemName[(subscript)]

2:Is the contents of a register (Rn). If a register is specified, the
 data in the register is printed. You must enter both the letter and
 the number. Refer to REPORT Register Statement for more information.

3:Is a series of characters enclosed in quotation marks.
The characters are printed without the surrounding quotation marks,
 and are printed once for each entry reported.

total T level,PrintElement,PrintPosition
[,SPACE A[number]] [,SPACE B[number]]
[,SKIP A/B]
[,EditOption]
[,ADD/AVERAGE/COUNT]
[,NOREPEAT]

T level, Rn

PrintElement 1:[DataBaseName:][DataSetName.DummyDataSetName.]DataItemName[(subscript)]

2:Is the contents of a register (Rn). If a register is specified, the
 data in the register is printed. You must enter both the letter and
 the number. Refer to REPORT Register Statement for more information.

3:Is a series of characters enclosed in quotation marks.
The characters are printed without the surrounding quotation marks,
 and are printed once for each entry reported.

ADD Prints the control group total of the values for the data item
 specified as print element. The print element must be the name
 of a numeric type data item.

AVERAGE Prints the control group average value for the data item specified
 as the print element. The print element must be the name of a numeric
 type data item.

COUNT Prints a count of the number of values for that control group.
The print element must be the name of a data item.

NOREPEAT Can only be used if the REPORT command follows a MULTIFIND command.
 The NOREPEAT option allows the total statement to be executed for a
 compound entry only if the simple entry has not been previously
 encountered in the statement. By default, the total statement is
 executed for all compound entries. The number of registers which
 use the NOREPEAT option, plus the number of sort levels for which
 the TOTAL statement uses NOREPEAT, must be less than or equal to 10.

Rn Is the register to be cleared.

edit E number,"edit mask"

AlphaNumeric edit mask

DATA ITEM VALUE EDIT MASK PRINTED RESULT
A34B "X//X-X-X-X" A//3-4-B-*
ABCD "- - - X" - - - A

Numeric edit characters

CHARACTER EXPLANATION

9 Each 9 in the edit mask is replaced with a decimal
 digit from the data item value in the corresponding
 position of the output field.

Z Z is a zero suppression place holder.
 A Z in the edit mask is replaced with a decimal digit
 from the data item value in the corresponding position
 of the output field. If the data item value digit under
 consideration is a zero appearing to the left of the
 leftmost significant digit, QUERY inserts a blank in
 the output field, and all other zeros to the left of
 the significant digit are replaced by a blank in the
output field.

* * is an asterisk place holder.
 An * in the edit mask acts just like a Z with the
 exception that leading zeros in the data item value
 are replaced with asterisks in the output field.

$ $ is the dollar sign place holder.
 A $ in the edit mask acts just like a Z, except that
 the first zero in the data item value to the left of
 the leftmost significant digit is replaced with the
 dollar sign in the output field. All zeros to the left
of the first leading zero are replaced with blanks in
 the output field.

CR CR is a sign character, and always appears in the two
 rightmost positions of the edit mask. If the data item
 value is negative, QUERY prints the two characters (CR)
 in the first two rightmost positions of the output field.
 If the data item value is positive, QUERY prints two blank
 characters in place of the CR. No characters from the data
 item value are ever placed in the first two rightmost
 positions of the output field.

- - is a sign character and acts the same as the CR characters.
 If the data item value is negative, QUERY prints the minus
 sign (-) in the rightmost position of the output field.
If the data item value is positive, QUERY prints a blank
in place of the minus. No character from the data item value
 is ever placed in the rightmost position of the output field.

Insertion characters
Insertion characters consist of any ASCII printing
characters not previously mentioned. Insertion characters
 are printed in the output field in the same position they
 appear in the edit mask. Any insertion character appearing
 in the edit mask to the left of the leftmost significant
digit of the data item value is replaced with blanks or
an asterisk, depending upon which zero suppression character
 is specified in the edit mask. Only one decimal point can
 appear in an edit mask.

SKIP A/B Skipping and Spacing
SPACE A/B When paging is in effect, the following rules govern skipping and spacing:

1.If a SKIP B and a SPACE B are both associated with the same
output line, the SKIP B is processed before the SPACE B.

2.If there are not enough lines remaining on the current page
 to satisfy a SPACE B, a page is ejected and then the spacing
 is effected.

3.If a SKIP A and a SPACE A are both associated with the same
 output line, the SPACE A is ignored.

4.If there are not enough lines remaining on the current page
 to satisfy a SPACE A, it is treated as a SKIP A.

5.A SKIP A on the last line of the report will not be executed.

6.SPACE A and SPACE B are allowed on the same REPORT statement.
 The SPACE B is done first, then the SPACE A.

OutputControlStatements

FORM PURPOSE

LINES=integer Specifies the number of lines per report page. integer can be
 between 10 and 32,767. If integer is 0, the page size is infinite.

NOPAGE Suppresses page advancing at the beginning of each page (no margins
 are provided at the top and bottom of each page). All SKIP options
 are ignored, and all SPACE options are performed unconditionally.

[OUT=]LP Sends the report output to the QSLIST device. Applies only to the
 current report. Refer to the OUTPUT= command for more information on QSLIST.

PAUSE Causes the report output to pause after each page completes. Press RETURN
to continue. PAUSE adds an extra line as RETURN is pressed. PAUSE is ignored
 in job mode or if output is sent to QSLIST.

UNIFYDETAIL Causes page eject when a particular block of detail statements would split
between two pages. A block is all the detail statements for each entry or
 compound entry.

NOPUNCH Causes negative values of type P, Z, I, J, and K to be printed without
 the overpunch characters. This statement only affects the output of header,
 detail, group, and total statements. This statement has no effect when used
 in the REPORT ALL command.

Example

>REPORT
>>H1,"NAME LIST",20,SPACE A2
>>D,LAST-NAME,20
>>D,FIRST-NAME,30
>>END

Example edit masks

DATA ITEM VALUE EDIT MASK PRINTED RESULT
0059 "$$$,999" $059
001024 "ZZZ,ZZZ" 1,024
-0010555 "$$,$$$.99CR" $105.55CR
00010555 "$$,$$$.99CR" $105.55
-0010555 "$$,$$$.99-" $105.55-
15039250 "$,$$$,$$$.99CR" $150,392.50
00049 "*****" ***49
044240474 "999-99-9999" 044-24-0474
-2145 "$,$$$.99" $21.45

REPORT ALL function

   Prints data item values of entries located by the last retrieval command without formatting.
Format
R[EPORT] [OutputControlStatement;] ALL [,character][,-]

Parameter

OutputControlStatements See under Report

character Is any printable ASCII character, except a minus sign (-).
When character is used, the data item names are omitted from
 the report. In addition, negative values of type P or Z and
 positive values of type Z are printed with an overpunch character.

- Is a minus sign. When a minus sign is used, the data item names
 are printed with the data item values. In addition, QUERY edits
 negative values of type P or Z and positive values of type P to
 include the value sign. If the minus sign (-) not is used,
negative values of type P or Z and positive values of type Z
are printed with an overpunch character.

SAVE Function

   Allows the TurboIMAGE data entries from the current select
file to be saved as a permanent self-describing file.

Format

SA[VE] FileName [/LockWord]

Parameters

FileName A MPE file name.

LockWord A lockword that will be associated with the file.

SETLOCKS Function

   To specify that the locks that result from any commands following the setlocks command
should be held until a release command is given.

Format

SET[LOCKS]

Parameters

-

SHOW Function

   Displays the current state of an aspect of the query environment.

Format

SH[OW] [option]

Parameters

option An aspect of the query environment:
DBLIST
JOIN
LANG[UAGE]
LOCKOPTION [DataBaseName]
INDEX [DataBaseName]
ALL

SUBSET Function

   To retrieve some or all of the entries which were retrieved by the most
 recent find, multifind or subset command. Entries will be retrieved if
 they meet the criteria specified in the subset command.

Format

SUB[SET] [#LIMIT=i;]
relation/ItemIdentifier [NO] M[ATCHING] "pattern"
[and/or relation/ItemIdentifier [NO] M[ATCHING] "pattern"]...
[END]

SUB[SET] ProcedureName [,character]

Parameters

i An integer specifying the maximum number of entries to be retrieved.

relation [DataBaseName:] [DataSetName.|DummyDataSetName.]DataItemName[(subscript)]
relop "value"/$MISSING [,"value"/$MISSING....]

ItemIdentifier [DataBaseName:] [DataSetName.|DummyDataSetName.]DataItemName[(subscript)]

DataBaseName Name of a data base.

DataSetName Name of a data set

DummyDataSetName A temporary DataSetName established by the join command.

DataItemName Name of a data item.

subscript Integer designating which sub-item to use. If omitted then
QUERY uses the first sub-item.

relop Is a relational operator:
IS / IE / EQ / = / ISNOT / INE / NE / # / <> / ILT / LT / < /
INLT / GE / >= / IGT / GT / > / INGT / LE / <= / IB

value Is a data item value. It must be the same type and within the
 same value range as the data item named in the relation.
 Value need not be enclosed in quote marks (") unless the
value contains special characters.

$MISSING Used to retrieve a missing (non-compound entry) from a compound data set.

ProcedureName Name of a subset command stored in the current proc-file.

character Is any printing ascii character.

pattern A mask specifying the form data retrieved must take.
Pattern must be enclosed in quote marks.
Detailded description under FIND command.

[NO]ATCHING Detailded description under FIND command.

TERSE Function

   Disables the verbose messages such as progress messages.
This is the default initial state.

Format

TERSE

Parameters

-

TRANSBEGIN Function

   To mark the beginning of a logical transaction for the purposes of
 TurboIMAGE logging and recovery.

Format

T[RANSBEGIN] [DataBaseName:] ["text"]

Parameters

DataBaseName Name of a data base. If omitted then the data base
 specified in either the DEFINE or DATA-BASE command
 (the primary data base), will be used.

text A character string to be written to the log file.

TRANSEND Function

   To mark the end of a logical transaction for the purposes of TurboIMAGE
logging and recovery.

Format

TRANSE[ND] [DataBaseName:] ["text"]

Parameters

DataBaseName Name of a data base. If omitted then the data base
 specified in either the DEFINE or DATA-BASE command
 (the primary data base), will be used.

text A character string to be written to the log file.

TRANSMEMO Function

   To write a message to the TurboIMAGE log file.

Format

TRANSM[EMO] [DataBaseName:] ["text"]

Parameters


DataBaseName Name of a data base. If omitted then the data base
 specified in either the DEFINE or DATA-BASE command
 (the primary data base), will be used.

text A character string to be written to the log file.

UNDO Function

   To return to the set of retrieved entries that existed
prior to the use of the most recent subset command.

Format

UN[DO]

Parameters
-

UPDATE ADD function

   To add data entries to a manual master or detail data set.

Format

U[PDATE] AD[D],DataSetName
U[PDATE] ProcedureName [,character]

Parameters

DataSetName Name of a data set

ProcedureName Name of an update add command stored in the current proc-file.

character Is any printing ascii character.

UPDATE DELETE Function

   To delete data entries from a data set.

Format

U[PDATE] DEL[ETE]
U[PDATE[ ProcedureName [,character]

Parameters

ProcedureName Name of an update delete command stored in the current proc-file.

character Is any printing ascii character.

UPDATE REPLACE Function

   To modify the values of data items.

Format

U[PDATE] REPL[ACE],DataItemName [(subscript)] = "value";
[DataItemName [(subscript)] = "value";]
.
.
.
[DataItemName [(subscript)] = "value";]
END

U[PDATE] ProcedureName [,character]

Parameters

DataItemName Name of a data item contained in the entries located by the find command.

subscript An integer which indicates which sub-item to use. If omitted then
 QUERY uses the first sub-item.

value New value for the data item.

ProcedureName Name of an update replace command stored in the current proc-file.

character Is any printing ascii character.

VERBOSE Function

   Enables the verbose messages such as progress messages for the find, subset,
 or multifind commands. The default time interval is 30 seconds which may be
 changed with an MPE/iX command :SETVAR HP_QUERY_PROGRESS_INTERVAL nnn
where nnn is 1 to 65000 seconds or 0 for the default.

Format -

VERBOSE

Parameters -

-

VERSION Function

   Display version, update, and fix information.

Format

V[ERSION]

Parameters
-

XEQ Function

   Read an ascii file containing commands and optional command parameters.

Format

X[EQ] FileName [,NODATA]

Parameters

FileName Name of a MPE ascii file.

NODATA File name contains just commands.


EXAMPLE(S)

     -

ADDITIONAL INFORMATION

Commands: