HP QUERY Скачать руководство пользователя страница 162

REPORT

>>H7,"INVENTORY",68

>>H8,"AMOUNT",68

>>D1,STOCK#,36

>>D1,LASTSHIPDATE,48

>> D1,R12,68,E1

>>E2,"XX/XX/XX"

>> E1,"$$$,$$$,$$$,$$$.99"

>>S2,BINNUM

>>S1,SUPPLIER

>>S,LASTSHIPDATE

>> R12,LOAD,ONHANDQTY

>> R12,MULT,UNIT-COST

>> R8,ADD,R12

>> T2,R8,68,E1,SPACE

B

>>G2,BINNUM,3,SPACE

B

>>G1,SUPPLIER,20

>>T2,"

*",70

>> T2,R8

>>T2,"BIN

TOTAL",14,SPACE

B,SPACE

A

>>TF,"TOTAL

INVENTORY",20,SPACE

B3

>>TF,"

**",71

>> TF,R9,68,E1,SKIP

A

>> R9,ADD,R12

>>END

In

the

example

ab o

v

e,

a

detail

statement

is

added

to

prin

t

the

con

ten

t

of

Register

12

and

edit

with

E1.

Three

register

statements

are

added

to

load

the

v

alue

of

ONHANDQTY

in

to

R12,

m

ultiply

b

y

UNIT-COST,

and

add

the

result

to

the

con

ten

ts

of

R8.

Three

more

total

statements

are

added

to

prin

t

the

con

ten

t

of

Register

8

at

eac

h

lev

el

2

con

trol

break,

to

clear

Register

8,

and

to

prin

t

the

con

ten

t

of

Register

9

on

the

nal

total

line.

The

last

register

statement

adds

R12

to

R9

eac

h

time

the

data

of

another

en

try

is

prin

ted

in

the

rep ort.

In

this

example,

all

register

statements

are

executed

ev

ery

time

a

new

en

try

is

pro cessed

b

y

the

REPOR

T

command.

AS

OF:

01/07/86

PAGE

1

BOBO'S

MERCANTILE

ON

HAND

INVENTORY

BIN#

SUPPLIER

STOCK

SHIP

DATE

INVENTORY

AMOUNT

ONHANDQTY

multiplie

d

by

UNIT-COST

------

|

0

H

&

S

SURPLUS

v

7391Z22F

8/13/85

$5,012.50

5405T14F

9/11/85

$12,129.60

6650D22S

12/17/85

$14,985.00

BIN

TOTAL

$32,127.10

^

ac

cumulated

R12

values

in

R8

|

R8

set

to

0

---

1

ACME

WIDGET

2457A11C

12/01/85

$553,477,666.95

BAY

PAPER

CO.

7391Z22F

12/01/85

$4,704.00

CARDINAL

MILLS

5405T14F

11/28/85

$1,396.00

3-126

QUERY/V

COMMANDS

Содержание QUERY

Страница 1: ...QUERY V Reference Manual HP 3000 MPE iX Computer Systems ABCDE HP Part No 30000 90042 Printed in U S A OCT 98 E1098 ...

Страница 2: ...nsequential damages in connection with the furnishing performance or use of this material Hewlett Packard assumes no responsibility for the use or reliability of its software on equipment that is not furnished by Hewlett Packard This document contains proprietary information which is protected by copyright All rights are reserved No part of this document may be photocopied reproduced or translated...

Страница 3: ...L format PREFACE This manual describes QUERY V the Hewlett Packard Data Base Inquiry Facility which is designed to run under the control of the HP 3000 Multiprogramming Executive MPE Operating System QUERY V enables you to access data in IMAGE data bases without writing a computer program In order to use QUERY you should know enough about the MPE Operating System to start a job or operate in sessi...

Страница 4: ...ts the ASCII character set In addition to this manual you may need to consult the following manuals TurboIMAGE XL Database Management System Reference Manual IMAGE SQL Adminstration Guide MPE iX Commands Reference Manual Using NS3000 iX Network Services Native Language Programmer s Guide Throughout this manual no distinction is made between TurboIMAGE XL and IMAGE SQL These manuals are both refere...

Страница 5: ...G QUERY V USING QUERY IN SESSION MODE 2 1 Running QUERY 2 1 Accessing Data 2 2 Using the Break Key 2 2 Using Control Y 2 2 Exiting QUERY 2 3 USING QUERY IN JOB MODE 2 3 Discussion 2 4 QUERY COMMANDS 2 5 IDENTIFYING THE QUERY ENVIRONMENT 2 8 LOCATING DATA 2 9 MODIFYING DATA 2 10 REPORTING DATA 2 11 USING PROCEDURES IN A PROC FILE 2 12 USING QUERY COMMANDS FROM AN XEQ FILE 2 13 3 QUERY V COMMANDS AL...

Страница 6: ...6 MULTIFIND 3 78 MULTIFIND ALL 3 82 MULTIFIND procedure 3 84 OUTPUT 3 85 PASSWORD 3 88 PROC FILE 3 90 REDO 3 92 RELEASE 3 95 RENAME 3 96 REPORT 3 97 REPORT ALL 3 130 REPORT procedure 3 134 SAVE 3 136 SETLOCKS 3 137 SHOW 3 138 SUBSET 3 139 SUBSET procedure 3 142 TRANSBEGIN 3 143 TRANSEND 3 144 TRANSMEMO 3 145 UNDO 3 146 UPDATE ADD 3 147 UPDATE DELETE 3 151 UPDATE REPLACE 3 153 UPDATE procedure 3 15...

Страница 7: ...SELF DESCRIBING FILES FILE DATA E 1 USER LABELS E 1 Global Information Label Format E 2 Item Description Label Format E 2 ITEM NAMES E 3 F USER DEFINED PROCEDURES Procedures F 1 Parameters F 2 Examples F 5 MPROC Procedure F 5 SPL MPROC Procedure F 6 COBOL MPROC Procedure F 8 COBOL Notes F 10 PASCAL MPROC Procedure F 10 PASCAL Notes F 13 Additional Comments F 14 FORTRAN MPROC Procedure F 14 QPROC P...

Страница 8: ...3 3 FORM SETS Output 3 50 3 4 FORM data item name Output 3 51 3 5 FORM data set name Output 3 51 3 6 FORM Output 3 53 3 7 General Report Format 3 100 3 8 Sample Report 3 101 3 9 Sample Output Using Numeric Edit Masks 3 109 3 10 REPORT Procedure Named SHIPMNTS 3 135 3 11 Billing Report From an XEQ File 3 162 C 1 Using Method 1 C 2 C 2 Using Method 2 C 3 C 3 Using Method 3 C 4 Contents 4 ...

Страница 9: ...T ALL Options 3 131 3 10 Overpunch Characters 3 131 3 11 Output of P and Z Type Values 3 132 3 12 Retrieval Command Relational Operators 3 140 B 1 General B 1 B 2 JOIN Command B 1 B 3 LIST Command B 1 B 4 PROC FILE Command B 1 B 5 REPORT Command B 2 B 6 Retrieval Command FIND MULTIFIND SUBSET B 2 B 7 SAVE Command B 2 B 8 TRANSMEMO Command B 2 B 9 Updating Command UPDATE ADD and UPDATE REPLACE B 3 ...

Страница 10: ......

Страница 11: ... In job mode any error messages are printed on the STDLIST device which is usually a line printer QUERY adheres to all of the IMAGE security provisions described in the IMAGE Reference Manual You must enter a valid password for the data base you want to use This password determines which information you can access in the data base QUERY report formatting capabilities enable you to design reports w...

Страница 12: ...he passwords required to read and or write the information The data base designer organizes data items into data sets for the purpose of accessing them as a group For example an employee data set could contain the items EMPID F NAME L NAME SOCSEC and SALARY A credit union data set could contain EMPID AMOUNT TRANSCODE and so forth Each data set is referenced by a data set name Each time you enter a...

Страница 13: ...s also in the IRONCO data base its fully quali ed name would be IRONCO EMPLOYEE BADGE Data Types The data base designer de nes each data item as a particular type depending on what kind of information is to be stored in the item A data item may be one of several types of integers real or oating point numbers or ASCII character information The FORM command can display the data type for each item Wh...

Страница 14: ...alent Data items with values 0 0 and 0 are also equivalent Literals When specifying the value of a particular data item you must sometimes surround the value with quotation marks This type of value is called a literal A character or string literal contains alphanumeric characters For example TANYA OAKLEY ZXR 93458273 3215 Character literals containing numeric values of the types listed under Integ...

Страница 15: ...its when printing R2 values R4 1 157920892373161 x 1077 0 8636168555094445 x 10 77 0 8636168555094445 x 10 77 1 157920892373161 x 1077 Largest accurate absolute integer is 36 028 797 018 963 967 QUERY rounds to 16 digits when printing R4 values CHARACTER Un 1 ASCII character lower case not allowed n ASCII characters lower case not allowed Xn 1 ASCII character n ASCII characters Notes on Table 1 1 ...

Страница 16: ...ort items If you want to know more about data set relations and sort items refer to the IMAGE Reference Manual description of the data base structure Sample Data Base Figure 1 1 and Figure 1 2 illustrate a sample data base named ORDERS The data base is used in many examples in this manual It contains six data sets The four master data sets are shown in the center column and the detail data sets on...

Страница 17: ...Figure 1 1 ORDERS Data Base Structure Figure 1 2 Sample Entry Values INTRODUCING QUERY V 1 7 ...

Страница 18: ... summary of the acceptable environments multiple mode 1 and mode 5 users multiple mode 6 and mode 2 users multiple mode 6 users and one mode 4 user multiple mode 6 and mode 8 users one mode 3 user one mode 7 user Subsets of these environments are also allowed For example there may be all mode 6 users or all mode 8 users There may also be one mode 1 user or all mode 5 users and so forth If a mode 3...

Страница 19: ...ot need to add or delete any entries and do not want anyone else to add or delete entries you should open the data base with mode 2 If you want to perform all the operations including adding and deleting entries you should open with mode 1 3 or 4 The following table gives the result of using each of these modes MODE RESULT 1 QUERY locks and unlocks the data base while performing operations Other u...

Страница 20: ...Figure 1 3 IMAGE QUERY Environments 1 10 INTRODUCING QUERY V ...

Страница 21: ...ccess to all data items and data sets in the data base This is true even if no passwords are de ned for the data base In some cases it is possible to gain access to some data without a password if the data base is designed to allow such access Passwords are de ned by the data base designer or administrator and control read and write access to information in a data base You must ask the data base a...

Страница 22: ...various device classes and sets up the correspondence between device classes and standard les QUERY uses a le named QSLIST to allow you to alter the normal output device to any other output device You must use an MPE FILE command to equate QSLIST to the device class you select The default device class is LP You then use the QUERY OUTPUT command to change the output le from STDLIST to QSLIST The me...

Страница 23: ...session or job mode Note In this manual user input including passwords is underlined when necessary for clarity In an actual session the password will not be echoed back to the screen Also in this manual examples are shown in uppercase letters When using QUERY you may use either upper or lowercase letters Passwords must be entered exactly as de ned by the data base administrator USING QUERY IN SES...

Страница 24: ...QUERY can be used to add delete replace locate and or report data in the data base s During QUERY execution you may need to temporarily return to the operating system to use the MPE FILE command to direct output to a speci c device such as a line printer Using the Break Key You use the break key to temporarily return to the operating system After you have nished entering MPE commands you return to...

Страница 25: ...ed If a QUERY command is longer than 72 characters you can continue it on the next line by using an ampersand as the last non blank character on the line to be continued As in session mode you must open a primary data base before you can access data You must do this at the beginning of your job le QUERY commands which access the data base must follow the identi cation of the primary data base If Q...

Страница 26: ...also have been used to open the primary data base In session mode the DATA BASE command prompts for the password and access mode In job mode this information must be supplied on separate lines in the correct order and without the prompts In this example the password is CLERK and the access mode is 5 The data set name CUSTOMER is speci ed for the data set list using the DATA SETS command The FIND c...

Страница 27: ... The FORM SHOW and VERSION commands show the current state of QUERY The REDO and LISTREDO commands allow you to list edit and re execute a previous command The ASSIGN RELEASE and SETLOCKS commands operate on the data set or data base locking option The TRANSBEGIN TRANSEND and TRANSMEMO commands operate on the transaction logging facility SAVE and UNDO operate on the internal select le used by QUER...

Страница 28: ...vironment speci cations OUTPUT Speci es the output device PASSWORD Speci es the password to access the primary data base PROC ENTITY Speci es the name of the current Proc le Retrieval FIND Locates data entries in the data base FIND ALL Locates all entries in the data set regardless of the data item value speci ed FIND CHAIN Locates data entries from a detail data set and one or more of its corresp...

Страница 29: ...rocedure stored in the current Proc le CREATE Stores a command as a procedure in the current Proc le CREATE SPACE Reports the number of unused records in the current Proc le DESTROY Deletes a procedure from the current Proc le DISPLAY Lists a procedure stored in the current Proc le DISPLAY LIST Lists the names of the procedures in the current Proc le RENAME Changes the name of a procedure in the c...

Страница 30: ...ta base can be the primary data base at any time You use the DATA BASE command to open the primary data base if you only want to open a data base The DATA BASE command prompts for the password and access mode You must specify a password if the data base has security and an access mode DATA BASE ORDERS PASSWORD CLERK MODE 5 You use the DEFINE command to open the primary data base if you want to de ...

Страница 31: ...he data base s according to data item values in the entries You can use retrieval commands to Locate entries in a single data set Locate entries in multiple data sets Locate all entries in one data set or multiple data sets regardless of the value of the data item speci ed Locate entries in multiple data bases Entries must be located before they can be reported replaced or deleted The located entr...

Страница 32: ...ries to a data set Delete data entries from a data set Change the value of data items not de ned as search or sort items of the data set You must have speci ed an access mode of 1 2 3 or 4 to use the updating commands If you opened the data base with another mode you can use the MODE DEFINE DATA BASE or MULTIDB command to specify another mode If you opened the data base with mode 2 you can only us...

Страница 33: ... to 9 lines of heading information such as a title column headings page numbers date and time of day This information can be repeated at the top of each report page You can specify blank lines to be interspersed in the heading as long as the heading does not exceed one page Sorted data entries with group and total information printed with entries belonging to the same group You can accumulate tota...

Страница 34: ... QUERY searches the current Proc le for the speci ed procedure Therefore before executing a procedure you must specify the current Proc le with the PROC ENTITY command or in response to the prompt issued by the DEFINE command To access a Proc le you must have read and lock access to the group and account in which the Proc le resides Table 2 2 Procedure Commands USED IN A PROCEDURE EXECUTES A PROCE...

Страница 35: ... execute an XEQ le For example you execute an XEQ le named LISTNAME by typing XEQ LISTNAME An XEQ le must be created using EDITOR TDP or any editor which operates on ASCII les You must exit QUERY to create an XEQ le The following is a list of di erences between an XEQ le and a procedure Only the commands listed in Table 2 2 can be used in a procedure but any QUERY command can be used in an XEQ le ...

Страница 36: ......

Страница 37: ...ed for comments or sequencing information If the command you want to enter is longer than 72 characters you can continue it on the next line by using an ampersand as the last character on the current line QUERY combines all lines connected with the continuation character Any blanks preceding the are saved Therefore if you break a command name or other parameter with an the should be adjacent to th...

Страница 38: ...our editing sequentially from lower numbered lines to higher numbered lines You cannot go back to a line which precedes the ones you are currently editing without exiting the ALTER command and entering another ALTER command This technique is illustrated in the examples which follow If an error occurs after a statement is entered an error message is printed and QUERY prompts you for another ALTER s...

Страница 39: ...sion The lines which follow the insert statement are inserted into the procedure following line number m You cannot insert lines in front of the rst procedure line To indicate you do not want to insert mores lines enter a slash followed by another ALTER statement Example ALTER FIND1 I 1 STOCK IS AND LASTSHIPDATE IS E The example above changes the procedure FIND1 from text 001 FIND 002 END To 001 F...

Страница 40: ...f the rst procedure line you want to replace n is the number of the last procedure line you want to replace If n is not speci ed only line m is replaced replacement line is the new line which will replace the existing line Example ALTER UPDATE1 R 2 3 HOURS DATE 851022 HOURS 14 DATE 851101 STATUS OK The example above changes the procedure UPDATE1 from text 001 UPDATE REPLACE 002 HOURS 003 DATE 8510...

Страница 41: ...es from m to n is deleted Discussion If you try to delete all the lines in the procedure an error message is printed To delete the entire procedure use the DESTROY command Example text ALTER REPORT4 D 4 5 S2 ORDERDATE S LASTSHIPDATE E The example above changes the procedure named REPORT4 from 001 REPORT 002 H1 MONTHLY SHIPMENTS 25 SPACE A2 003 S1 STOCK 004 S2 ORDERDATE 005 S LASTSHIPDATE 006 G1 ST...

Страница 42: ...mmand with E Example text DISPLAY REPORT2 PROCEDURE REPORT2 001 REPORT 002 H1 AS OF 6 003 H1 DATE 15 004 H2 BOBO S MERCANTILE 45 005 H1 PAGE 69 006 H1 PAGENO 71 007 D1 STOCK 36 008 D1 LASTSHIPDATE 48 E2 009 E2 XX XX XX 010 END The following is an example of using the ALTER command with all four statements The DISPLAY command can be used to examine the procedure and the results of the ALTER command...

Страница 43: ...ALTER 001 REPORT 002 H1 TO DATE 6 003 H1 DATE 20 004 H2 BOBO S MERCANTILE 45 005 D1 STOCK 36 006 D1 LASTSHIPDATE 48 E2 007 E2 XX XX XX 008 S LASTSHIPDATE 009 END QUERY V COMMANDS 3 7 ...

Страница 44: ...changes made by other users concurrently accessing the same data In some cases automatic locking may be overprotective if no other users can concurrently modify data that a ects your retrieval or reporting command For example protection may be provided through data base passwords or through exclusive scheduling of tasks In such cases automatic locking by QUERY can needlessly increase response time...

Страница 45: ...y want to close a data base opened with a MULTIDB command for the following reasons 1 You have reached the limit of 10 open data bases that QUERY allows 2 You want to re open your data base with the DEFINE or DATA BASE command so that it will be the primary data base 3 You have exclusive access and or have nished using the data base and want to allow access to other users A data base closed with t...

Страница 46: ...mmand cannot be embedded with the DEFINE DATA BASE REPORT ALTER or UPDATE ADD commands since it will be interpreted as input Example COMMENT This retrieves all the accounts in Salt Lake City and reports the account number and shipping date COMMENT FIND ACCOUNT CITY 05 REPORT H1 SALT LAKE CITY ACCOUNTS 50 H2 50 SPACE A2 H1 DATE 70 S ACCTNUM D1 ACCTNUM 20 D1 SHIPDATE 40 END 3 10 QUERY V COMMANDS ...

Страница 47: ...ames from the command parameter FINDX and other supersets are acceptable command is one of the commands listed in Table 2 2 Refer to the command in this section for the syntax of the command Discussion You can create a procedure in two ways from input stored in an MPE ASCII le from input entered through the session or job input device If the procedure you are creating does not t in the available P...

Страница 48: ...Proc le is declared When the CREATE command is issued FINDACCT is created and listed on the screen Terminal Input If you enter a procedure through a terminal in session mode or through a standard input device in job mode the command can be entered on one line or on as many lines as necessary without the use of the continuation character Whenever you press 4RETURN5 QUERY prompts for additional line...

Страница 49: ...FIND CREDIT RATING ILT 5 END FIND CHECK USING SERIAL READ 2 ENTRIES QUALIFIED CREATE NAMES REPORT D LAST NAME 20 REPORT NAMES PAUSE END MCFALL CELERY The previous example shows two procedures The second procedure NAMES operates on the results of the rst procedure CHECK The procedure named CHECK is useful each time you want to nd the names of customers with low credit ratings The NAMES report proce...

Страница 50: ...e lost If you know there is not enough space left you can either create a new Proc le declare another Proc le which has more space available or delete unused procedures from the current Proc le Each stored procedure starts on a record boundary and extends through as many records as necessary Generally one record is su cient for most UPDATE and FIND commands Long REPORT commands may take more than ...

Страница 51: ...ta base using QUERY refer to Appendix C Discussion This command is used to specify the primary data base You must use either this command or the DEFINE command to identify the primary data base before you can use QUERY commands which access a data base You can specify a new primary data base at any time and you can open additional data bases with the MULTIDB command When you enter the DATA BASE co...

Страница 52: ... the speci ed data base When this happens the following message is returned PASSWORD DOES NOT MATCH ANY DEFINED FOR SPECIFIED DATA BASE USER CLASS ZERO 0 WAS ASSIGNED If there are no data sets and or data items which you can access the following message will be returned BAD PASSWORD If you are not sure that you will have access to the data items that you need you can change the password with the D...

Страница 53: ...hows two users for the ORDERS data base User 2 must open the data base with mode 5 because mode 6 is incompatible with the access mode of user 1 User 1 has requested mode 1 exclusive read and write access QUERY V COMMANDS 3 17 ...

Страница 54: ...ich is in more than one data set in the primary data base QUERY will check the data set list to determine which data set to use In an IMAGE data base di erent data items can have the same name if each appears in a di erent data set As mentioned in Section 1 you can use a fully quali ed data item name data set name data item name to tell QUERY which data item to use However if you are using fully q...

Страница 55: ...r of the data sets that include the data item You can then decide what to include in the data set list QUERY will inform you of which data set was chosen if there is any ambiguity with this message data item name IS A MEMBER OF THESE SETS data set name data set name data set name USED Automatic Data Set List Additions If a FIND or LIST command is executed which contains an unquali ed data item nam...

Страница 56: ...data set list When FIND STOCK 7391Z22F is entered the INVENTORY data set is used However in the next FIND command the data set SALES is speci ed In this case the data set list is not used DEFINE DATA BASE ORDERS PUB SYS DATA BASE 4RETURN5 PASSWORD PASSWORD 4RETURN5 MODE 1 MODE 4RETURN5 DATA SETS SALES DATA SETS 4RETURN5 PROC FILE MANPROC IMAGE DATAMGT PROC FILE 4RETURN5 OUTPUT TERM OUTPUT 4RETURN5...

Страница 57: ...t The DBLIST command de nes a list of one or more data bases When you use a JOIN MULTIFIND SUBSET or REPORT command after a MULTIFIND command and QUERY encounters a data item name which appears in more than one data base but is not fully quali ed it checks the data base list to resolve the ambiguity Data Base Selection Rules Session Mode If you reference a data item appearing in more than one data...

Страница 58: ...ere was any ambiguity QUERY informs you which data base was used with the following message data item name IS A MEMBER OF THESE DATA BASES data base name data base name data base name USED Automatic Data Base List Additions If a JOIN MULTIFIND SUBSET or REPORT command which contains an unquali ed data item name is executed following a MULTIFIND command QUERY automatically adds the accessed data ba...

Страница 59: ...data set In the second occurrence the data base list is not used since a fully quali ed data item name is speci ed The DBLIST command clears the data base list Since the data base list is cleared when the REPORT command is entered QUERY prompts for the data base to be used TAPES is automatically added to the data base list When the next MULTIFIND command is entered QUERY automatically uses the TAP...

Страница 60: ...rst use the DEFINE command after initializing QUERY execution none of the command settings will be listed except OUTPUT TERM If you do not want to de ne a particular environment parameter respond with 4RETURN5 If you are only doing procedure maintenance you need not specify a data base On the other hand if you are not using procedures you do not have to de ne a Proc le If you are signed on as the ...

Страница 61: ...data base name password mode data set list and procedure le name The current output device is the terminal because 4RETURN5 is pressed in response to the prompt Example 2 DEFINE DATA BASE ORDERS DATA BASE 4RETURN5 PASSWORD PASSWORD 4RETURN5 MODE 5 MODE 4RETURN5 DATA SETS 4RETURN5 PROC FILE MANPROC PROC FILE CANNED OUTPUT TERM OUTPUT 4RETURN5 The DEFINE command is also useful for listing the curren...

Страница 62: ...oc le Discussion This command deletes a procedure from the current Proc le If the Proc le has not been declared or if the named procedure does not exist in the Proc le QUERY informs you and prompts you for another command If the procedure does exist in the Proc le it is deleted Example PROC FILE MANPROC DISPLAY LIST FIND1 FIND2 UPD1 UPD2 REP4 REP5 DESTROY UPD2 D LIST FIND1 FIND2 UPD1 REP4 REP5 3 2...

Страница 63: ...xist or if no Proc le has been declared you are informed and prompted for another command If the procedure does exist it is listed with line numbers for reference when editing the procedure with the ALTER command If line numbers m n are included in the DISPLAY command only those lines speci ed will be listed If only m is included the procedure will be listed from line m to the end of the procedure...

Страница 64: ...SET Then FIND1 is listed on the terminal OUT LP D FINDCH OUT TERM D FINDCH PROCEDURE FINDCH 001 FIND CHAIN 002 CUSTOMER ACCOUNT SALES ACCOUNT 003 IS END When OUTPUT LP the list is printed on the QSLIST device When OUTPUT TERM the list is printed on the terminal D FINDCH 2 PROCEDURE FINCH 002 CUSTOMER ACCOUNT SALES ACCOUNT 003 IS END A single line or a range of lines can be displayed 3 28 QUERY V C...

Страница 65: ...mmand the DISPLAY LIST command prints information on both the QSLIST device and the terminal in session mode In this case the procedure listing includes a header containing the procedure le name and the date you displayed the procedure names Example PROC FILE MANPROC OUTPUT LP DISPLAY LIST FIND1 FIND2 UPD1 UPD2 REP4 REP5 If OUTPUT LP DISPLAY LIST lists on both the terminal and the QSLIST device Be...

Страница 66: ...system The operating system then prompts you for a command with the colon prompt character In job mode you must use an EXIT command to terminate a set of QUERY commands The EXIT record should be followed by an MPE command usually EOJ Refer to Section 2 for further information on using QUERY in job mode Example EXIT END OF PROGRAM BYE CPU 9 CONNECT 6 MON MAR 23 1987 10 31 AM 3 30 QUERY V COMMANDS ...

Страница 67: ...e item identi er takes the form data base name data set name data item name subscript data base name is the name of a data base speci ed in either the DEFINE DATA BASE or MULTIDB command data set name is the name of a data set in a currently open data base If a data base is speci ed the data set must belong to that data base data item name is either the name of a simple data item or the name of a ...

Страница 68: ...ompt you for the values that you want to retrieve Refer to Using Null Values under the FIND command END must be included in a procedure Methods of Retrieval If a FIND command is entered QUERY will use either a keyed indexed or a serial method of retrieval A keyed retrieval occurs when master or detail data set search keys can be used to locate entries A serial read occurs when the data set require...

Страница 69: ...ry selected you connect relations with the logical connectors AND or OR The AND connector instructs QUERY to select only those entries whose data item values satisfy the relations on both sides of the AND The OR connector indicates that the entries are selected if one or both of the two relations on either side of the OR is satis ed Both types of logical connectors can appear in a FIND command All...

Страница 70: ...ltiple values can only be used with the equal or not equal relational operators Using Null Values The FIND command can prompt you for data item values to be compared with data item values in the data entries of the data set To do this you use null data item values in the command Null values are represented by a pair of quotation marks without any intervening characters or blank spaces When the com...

Страница 71: ...following the FIND command Examples Example 1 To determine whether or not a customer is already in the data set you can try to nd the name FIND LAST NAME IS MARTENSEN USING SERIAL READ 0 ENTRIES QUALIFIED Example 2 Since ACCOUNT is in more than one data set you can either qualify the data item name or let QUERY prompt you for it The response SALES is automatically entered in the data set list FIND...

Страница 72: ...TATE IS CA OR ACCOUNT IS 121212121 AND STATE IS MA OR CUSTOMER STATE IS AZ ACCOUNT IS A MEMBER OF THESE SETS CUSTOMER SALES WHICH SET DO YOU WISH TO USE CUSTOMER INVALID NUMERIC DIGIT Example 5 All items which appear in multiple sets must be quali ed unless the set name is in the set list After entries are located you can use the REPORT command to print the data F CUSTOMER ACCOUNT IGT 55555555 AND...

Страница 73: ...The matching pattern can include speci c characters in addition to the types listed above For example MATCHING Aaa dddd The pattern above means that the value must start with the letter A followed by any two upper or lowercase letters followed by a hyphen and any four digits For example the values Acs 1234 and AAA 9999 are acceptable but the values Bcs 1223 and A12 345 are not acceptable Transpare...

Страница 74: ...CHING a b c d e f Grouping and Optional You can group pattern speci cations by enclosing the pattern in braces f g or brackets Braces indicate that data must correspond to one item in the group Brackets make the pattern optional indicating that data can correspond to one or none of the items in the pattern For example MATCHING AAA BBB CCC ddd One of the choices within the braces must be matched Th...

Страница 75: ...alphabetic value MATCHING Xu b This pattern accepts X alone or followed by any number of uppercase letters For example XABC or XX or X are all acceptable MATCHING M A D d Any of the enclosed characters can be repeated in any order or can be omitted Thus MMMM is acceptable as are MAA1 MCCA M222 and so forth When you use a pattern to nd variable length values such as 1 12 and 123 you must indicate t...

Страница 76: ...s es the match MATCHING A B dd accepts values such as A B and 22 Range of single characters in ascending ASCII order any one of which satis es the match MATCHING 2 6 accepts the values 2 3 4 5 or 6 Grouping required requires one occurrence of any pattern within braces MATCHING A B dd d accepts A223 B34 A795 and so forth Grouping optional allows zero or 1 occurrence of any item in a pattern within ...

Страница 77: ...fy are placed in the select le item identi er takes the form data base name data set name data item name data base name is the name of a data base speci ed in the last DEFINE DATA BASE or MULTIDB command data set name is the name of the data set you want to access data item name is the name of any data item in that set Discussion If you want to locate all entries in a data set and use these entrie...

Страница 78: ... 24566356 10034765 FIND ALL LAST NAME USING SERIAL READ 13 ENTRIES QUALIFIED Both FIND commands locate entries in the CUSTOMER data set The REPORT command prints the value of ACCOUNT for each entry 3 42 QUERY V COMMANDS ...

Страница 79: ...tem BADGE value 1234 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 speci ed only the rst quali ed entries are placed in the select le If fewer than i entries exist all entries that qualify are placed in the select le item identi er takes the form m...

Страница 80: ...ed chains The e ect of FIND CHAIN is to locate all the members of a detail chain and the master data entry which constitutes the chain head For more information on chains chain heads and data set relations consult the IMAGE Reference Manual When using the FIND CHAIN command Only selection on the basis of equality may be made Relational operators other than IS IE EQ and are not allowed Only one val...

Страница 81: ...TE CA ZIP 93921 CREDIT RATING 3 20000 STOCK 6550D22S DESCRIPTION BASEBALL BAT ACCOUNT 54283545 LAST NAME MAYFIELD FIRST NAME WILLIAM INITIAL STREET ADDRESS 39 41ST AVE CITY PETALUMA STATE CA ZIP 10101 CREDIT RATING 8 50000 ACCOUNT 54283545 STOCK 4397D13P QUANTITY 1 PRICE 4590 TAX 276 TOTAL 0 PURCH DATE 121585 DELIV DATE 121685 QUERY V COMMANDS 3 45 ...

Страница 82: ...Discussion QUERY searches the current Proc le and executes the procedure named in the command If the Proc le has not been declared or the procedure does not exist in the Proc le or the procedure is incorrect in some way you are informed by an error message If character is included in the command QUERY prints the procedure on the standard list device before executing it If null data values appear i...

Страница 83: ...ACCT procedure contains FIND CHAIN CUSTOMER ACCOUNT SALES ACCOUNT IS END In this example QUERY prompts for the value of ACCOUNT The REPORT ALL command prints the entry data The rst entry is from the CUSTOMER master data set The second entry is from the SALES detail data set QUERY V COMMANDS 3 47 ...

Страница 84: ...base name is the name of a data base opened with either MULTIDB DEFINE or DATA BASE commands If not speci ed FORM will use the primary data base currently de ned by the DEFINE or DATA BASE command data base name may be used to qualify ALL data base name must be followed by a colon when qualifying another parameter ITEMS lists information about each data item in the data base to which you have acce...

Страница 85: ...hrough Figure 3 6 illustrate the output resulting from each FORM command option If you enter FORM name and name refers to both a data set and a data item the data set information is listed If a data set or a data item has the name SETS ITEMS or PATHS it is treated as a keyword parameter when used in a FORM command DATA BASE ORDERS 1 2 TUE JAN 7 1986 11 29 AM DATA BASE LANGUAGE ATTRIBUTE NATIVE 300...

Страница 86: ...ta set and the master data sets associated with each detail data set It also lists the detail set item which is used as a key search item name and the detail set item which is used for sorting if any DATA BASE ORDERS TUE MAR 9 1987 11 29 AM DATA BASE LANGUAGE ATTRIBUTE NATIVE 3000 ITEM ENTRY ENTRY BLOCKING SETS TYPE COUNT CAPACITY COUNT LENGTH FACTOR CUSTOMER M 9 2003 15 41 10 DATE MASTER A 1 211 ...

Страница 87: ... item type 2 Data set names DATA BASE ORDERS TUE MAR 9 1987 11 29 AM DATA BASE LANGUAGE ATTRIBUTE NATIVE 3000 SET NAME CUSTOMER MANUAL 1 ITEMS ACCOUNT 2 J2 3 KEY ITEM LAST NAME X16 FIRST NAME X10 INITIAL U2 STREET ADDRESS X26 CITY X12 STATE X2 ZIP X6 CREDIT RATING R2 CAPACITY 2003 4 ENTRIES 15 5 Figure 3 5 FORM data set name Output Discussion 3 5 1 CUSTOMER is a manual master data set 2 Data items...

Страница 88: ...inks the detail data set SALES to the master data set CUSTOMER The detail search item is is also named ACCOUNT 2 DATE is a key item in DATE MASTER linked to the SALES data set through the search item PURCH DATE 3 PURCH DATE is also used for sorting 4 The SALES data set can contain at most 12012 entries 5 Data set relations 3 52 QUERY V COMMANDS ...

Страница 89: ...APACITY 211 ENTRIES 18 SET NAME SALES DETAIL ITEMS ACCOUNT J2 1 SEARCH ITEM STOCK U8 SEARCH ITEM TOTAL J2 PURCH DATE X6 2 3 SEARCH ITEM SORT ITEM CAPACITY 12012 4 ENTRIES 13 PATH IDENTIFYING INFORMATION 5 ASSOCIATED MASTER SET NAME DETAIL SET NAME SEARCH SET NAME SORT ITEM NAME CUSTOMER SALES ACCOUNT PURCH DATE DATE MASTER SALES PURCH DATE ASSOCIATED DETAIL SET NAME SEARCH ITEM NAME SORT ITEM NAME...

Страница 90: ... a list of the QUERY commands followed by a brief description of the function of each command If you enter HELP command name you receive information about the format function and parameters of the command if any If you enter HELP command name followed by one or more of the parameters FUNCTION FORMAT or PARAMETERS QUERY provides only the information you request HELP output is listed on the standard...

Страница 91: ...TA BASE NAME PARAMETERS DATA BASE NAME NAME OF 4CONTROL5 Y CONTROL Y Example 2 The order of FUNCTION PARAMETERS and FORMAT parameters can vary 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 QUERY V COMMANDS 3 55 ...

Страница 92: ... data base data item name is the name of the data item that links the joined data sets together The data item must belong to the speci ed data set subscript is a number used to indicate which sub item you want to join Subscript must be an integer 1 and the number of sub items de ned for the compound item QUERY will default to the rst sub item if no subscript is speci ed means preserve all values o...

Страница 93: ...enter the JOIN command JOIN PRODUCT STOCK TO SALES STOCK SALES STOCK TO INVENTORY STOCK MULTIFIND PRODUCT DESCRIPTION NAIL USING SERIAL READ 2 COMPOUND ENTRIES QUALIFIED In order for the JOIN command to be valid all data sets used in the JOIN command must be logically connected to one another so that each data set is traceable to every other data set through the data item equivalences If logical c...

Страница 94: ...e for the data item named in the data item equivalence occurs more than once in one of the data sets named in the equivalence and at least once in the other data set named this entry will be repeated in the compound data set Given the following data sets and a data item equivalence using upper limit and price the name JOHN SMITH will appear twice in the compound data set CLIENT SELLER NAME UPPER L...

Страница 95: ...re not considered equivalent to leading blanks Packed Data Type Items When QUERY converts a di erent data type to packed it uses a COBOL Convention a positive sign of 1100 a negative sign of 1101 and unsigned 1111 Positive and unsigned numbers are considered equivalent Data Set Equivalence Equating data sets is a way of renaming a data set to enable the information contained in it to be used in mo...

Страница 96: ...EPORT H1 Employee Name 30 H1 Manager Name 55 SPACE A2 D1 EMP DETAIL EMP NAME 27 D1 MGR DETAIL EMP NAME 55 END Employee Name Manager Name G SMITH H JONES H JONES J PRESIDENT Using the Parameter The optional parameter allows you to preserve all of the data item values in one of the data sets of a data item equivalence The values in the data set which is next to the on the same side of the TO as the ...

Страница 97: ...sing entries can be retrieved using the MULTIFIND or SUBSET command with the MISSING parameter Placing the sign on the other side of the TO preserves all entries in the data set STOCK DETAIL and marks missing entries from the SALES DETAIL with asterisks The next JOIN command produces the following compound data set JOIN SALES DETAIL STOCK TO STOCK DETAIL STOCK SALES DETAIL STOCK DETAIL ACCT STOCK ...

Страница 98: ...e 1 In this example an sign is associated with SETA in the equivalence between SETA and SETB Therefore the data set on the opposite side of the TO from the sign SETB must also have an sign associated with it The sign associated with SETB requires that sign be associated with SETC The sign associated with SETC requires that an sign be associated with SETD if SETD was joined to another data set Sinc...

Страница 99: ... are connected with other data sets Only SETC has an additional connection and requires an sign JOIN SETA ITEM1 TO SETB ITEM2 SETB ITEM1 TO SETC ITEM2 SETC ITEM1 TO SETD ITEM4 Example 4 In the equivalence between SETA and SETB SETA has the sign associated with it Therefore every time SETB is connected to another data set an must be associated with it This accounts for the two signs associated with...

Страница 100: ...form Note It may be helpful to diagram the connections established by the JOIN command as shown in this section When the parameter is used a diagram can allow you to easily see where an must be propagated A diagram will also reveal any illegal connections made with the parameter 3 64 QUERY V COMMANDS ...

Страница 101: ...e PROC FILE prompt character is any printable ASCII character If character is included in the command the JOIN procedure is listed Discussion QUERY searches the current Proc le de ned by a DEFINE or PROC FILE command and executes the procedure named in the command If the Proc le has not been declared the procedure does not exist in the Proc le or the procedure is incorrect in some way you are info...

Страница 102: ...lay characteristics For example the user language is used when sorting data in a report or when determining the thousands separator and decimal point when displaying numbers If no LANGUAGE command is entered the default language is NATIVE 3000 This means that QUERY will operate in the same way as before Native Language Support enhancements were made Each computer system supports a set of languages...

Страница 103: ...nd can be listed in any order A data item cannot be quali ed with a data set name but the rst data item can be quali ed with a data base name subscript is a number to indicate which sub item you want to locate Subscript is entered with parenthesis and must be an integer 1 and to the number of sub items de ned for the compound item QUERY will default to the rst sub item if no subscript is speci ed ...

Страница 104: ...scussion The maximum number of logical connectors AND OR which can be used in the LIST command is 10 Refer to Logical Connectors under the FIND command The LIST command prints all or a subset of the data item values from a single data set It is one of the simplest ways to report on your data since you do not need to design a report or specify the format and headings LIST always uses a serial read ...

Страница 105: ...ful if the complete data entry does not t on one line You can change the order of the data items and print the last ones in the data entry rst or print only the last items Use the FOR parameter to set criteria for selection of entries from the set For example LIST LABOR FOR SERVICEYRS GE 5 lists the value of all data items in each entry of the LABOR data set containing SERVICEYRS values greater th...

Страница 106: ...e except the output of this command The entries selected by the most recent FIND command are una ected by LIST and are still available for use with UPDATE and REPORT commands Examples Example 1 In the example below QUERY could not locate the required entry until the value was entered with the correct spacing L CUSTOMER FOR STREET ADDRESS 868 DOYLE ROAD L CUSTOMER FOR STREET ADDRESS 868 DOYLE ROAD ...

Страница 107: ...es in order to get the items at the end of each entry LIST LAST NAME STREET ADDRESS CITY STATE FOR ACCOUNT GT 55555555 ACCOUNT IS A MEMBER OF THESE SETS CUSTOMER SALES WHICH SET DO YOU WISH TO USE CUSTOMER LAST NAME STREET ADDRESS CITY ST MCFALL 6650 MONTEREY ROAD CARMEL CA FIELD 4556 GEARY CUPERTINO CA JONES 1 PINE AVE CAMPBELL CA Example 6 This example lists all STOCK in the data set INVENTORY L...

Страница 108: ...T14F 7892Z43Y Example 8 SALES and INVENTORY are both in the data set list so QUERY must prompt you for the data set LIST STOCK STOCK IS A MEMBER OF THESE SETS SALES INVENTORY WHICH SET DO YOU WISH TO USE INVENTORY 6650D22S 2457A11C 3586T14Y 5405T14F 6650D22S 7892Z43R 3 72 QUERY V COMMANDS ...

Страница 109: ...D RESULT omitted omitted All commands in history bu er are displayed m n Command m through command n are displayed m omitted Command m through the last command are displayed omitted n The rst command through command n are displayed ABS displays the absolute command numbers ABS is the default Absolute numbers are positive numbers beginning with the rst least recent command in the command history bu...

Страница 110: ... when the bu er is displayed three commands are listed since the LISTREDO command is added to the bu er The next LISTREDO command lists all the commands in the commands history bu er with relative numbers Finally the third LISTREDO command lists the third most recent command through the most recent command with relative numbers LISTREDO 1 DEFINE 2 FIND FINDX 3 LISTREDO LISTREDO REL 4 DEFINE 3 FIND...

Страница 111: ...and is entered QUERY rst closes the current primary data base before attempting to open the data base with the new access mode Example text MODE 6 AD INVENTORY ILLEGAL ACCESS MODE 3 AD INVENTORY STOCK 6650D22S ONHANDQTY 11 SUPPLIER H S SURPLUS UNIT COST 1395 LASTSHIPDATE 121585 BINNUM 3 STOCK In the example above mode 6 is speci ed Since mode 6 does not allow write access to the primary data base ...

Страница 112: ...as in the DEFINE command To clear the data sets list for a speci c data base enter two asterisks after the DATA SETS prompt MULTIDB will continue to prompt you for these speci cations until a carriage return or two slashes is entered at the DATA BASE prompt Entering a carriage return has no e ect on the current environment speci cations If you are signed on as the creator and enter a semicolon in ...

Страница 113: ...ne opened with the DEFINE or DATA BASE command If the data base is in another group and or account then the group and or account name must be speci ed The JOIN MULTIFIND SUBSET and REPORT commands will prompt for a data base name if there is any ambiguity The DBLIST command may be used to specify which data base s to use The MULTIDB command can be used to open more data bases or to modify the envi...

Страница 114: ...a base name is the name of a data base speci ed in either the DEFINE DATA BASE or MULTIDB command data set name is the name of a data set named in the most recent JOIN command dummy data set name is a temporary data set name established in the most recent JOIN command data item name is the name of a data item belonging to one of the data sets named in the most recent JOIN command For matching the ...

Страница 115: ...nd can only be used to retrieve data entries that belong to a compound data set resulting from a JOIN command When a MULTIFIND command is entered whether valid or invalid the internal select le is cleared The MULTIFIND command does not lock the data sets named in the JOIN command for the duration of the formation of the compound data set but only locks while reading data set entries If you want lo...

Страница 116: ...in the optional MISSING parameter which allows you to retrieve a missing non compound entry from a compound data set Missing entries result when the JOIN command contains the optional parameter For more information on missing entries refer to the JOIN command A missing entry is retrieved from a compound data set by comparing a data item with the value MISSING in a relation This parameter allows th...

Страница 117: ... scanning without bene t of search items A Sort Merge retrieval occurs if the compound data set requires sorting and merging of two or more data sets Because the Sort Merge method of searching and retrieval may take considerable time it is generally advisable to avoid it when accessing multiple data sets You can abort a search by entering a 4CONTROL5 Y QUERY will print the number of qualifying ent...

Страница 118: ...nd and named in the most recent JOIN command data set name is the name of a data set used in the most recent JOIN command If data base name is speci ed the data set must belong to that data base dummy data set name is a temporary data set name established in the most recent JOIN command data item name is a data item belonging to one of the data sets named on the most recent JOIN command If data se...

Страница 119: ...T ALL TOOLS SALES DETAIL ACCT 111 STOCK 50 QUAN 100 TOOLS INVENTORY DETAIL STOCK 50 DESCR NAIL ON HAND 1000 TOOLS SALES DETAIL ACCT 111 STOCK 60 QUAN 20 TOOLS INVENTORY DETAIL STOCK 60 DESCR BOLT ON HAND 1200 Note that a REPORT ALL will show you the order that the data sets were joined together This may not be in the order that you speci ed them in the JOIN command as QUERY optimizes the actual jo...

Страница 120: ...ssion QUERY searches the current Proc le and executes the procedure named in the command If the Proc le has not been declared the procedure does not exist in the Proc le or the procedure is incorrect in some way you are informed by an error message For more information on storing and using procedures refer to the CREATE command If null data values appear in the procedure QUERY prompts you for the ...

Страница 121: ...ode you can use the 4BREAK5 key or terminate QUERY to enter the MPE FILE command or you can enter the FILE command before running QUERY If you are operating in job mode you can place a FILE command in your job preceding the RUN QUERY command All error messages and QUERY prompts are always sent through the STDLIST device regardless of whether OUTPUT TERM or OUTPUT LP Using the MPE FILE Command If y...

Страница 122: ... create FILE QSLIST fname NEW DEV DISC If you use the NEW option in a FILE command and the le already exists QUERY prints the following message QSLIST ALREADY EXISTS PURGE OLD FILE If you respond with Y QUERY overwrites the existing le If you respond with N a le system error message is returned and OUTPUT is reset to TERM If you want QUERY to append to an existing le you must use the APPEND option...

Страница 123: ...ISPLAY FNAMES OUTPUT TERM Example 3 In this example one entry is retrieved with the FIND command and is displayed with the REPORT ALL command Next the 4BREAK5 key is used to temporarily return to the operating system The FILE command redirects QSLIST to a disc le named SAVER which QUERY creates QUERY execution is resumed Finally the OUTPUT LP and REPORT ALL commands are used to write data to the S...

Страница 124: ...e even if there are no passwords speci ed for the data base To take advantage of the non echoing feature of QUERY enter the PASSWORD command without the password parameter and press 4RETURN5 QUERY will prompt you for the password and when entered it will not be echoed back If you enter an invalid password you are assigned a user class zero that allows you read and or write access to some or all of...

Страница 125: ...sword is speci ed The request to add an entry to the INVENTORY data set is rejected since CLERK does not allow write access to it When the password is changed to DO ALL QUERY allows the user to add to the INVENTORY data set QUERY V COMMANDS 3 89 ...

Страница 126: ...ies one or more records If n is speci ed for an existing le it is ignored Discussion Procedures are stored in the Proc le Before using any of the QUERY procedure commands you must specify the name of the Proc le This de nition stays in e ect until changed with the PROC FILE or DEFINE command or until execution terminates If the le name does not exist QUERY issues a message and opens and saves a di...

Страница 127: ...t Proc le MANPROC contains ve procedures PROC FILE MANPROC DISPLAY LIST FIND1 FIND2 UPD1 REP4 REP5 Example 2 You can create a Proc le with the PROC FILE command If you do not specify the number of records QUERY creates a le with 126 records PROC FILE PROCX FILE DOES NOT EXIST BEING CREATED QUERY V COMMANDS 3 91 ...

Страница 128: ...nd is issued you are placed into an edit mode to modify the speci ed command The subcommands discussed next can then be used to change the displayed command You type the subcommands on the line below the line you are currently editing You can type the subcommands in either upper or lowercase characters Any characters other than the subcommands are interpreted as replacement characters The REDO com...

Страница 129: ... the nth line backward in the current command for editing By default n is 1 Therefore and 1 have the same e ect 4RETURN5 displays the next line for editing If the current line is the last line the edited command is executed The ampersand continuation character is not used to continue a command that is being edited Examples Example 1 In the example below the LISTREDO command is rst used to display ...

Страница 130: ... bu er are displayed with the LISTREDO command When the REDO command is executed the most recent command that begins with FIND is displayed LISTREDO 5 1 DEFINE 2 FIND ALL CUSTOMER ACCOUNT 3 MULTIDB 4 FIND PROCF5 5 LISTREDO 5 REDO FIND FIND PROCF5 I2 FIND PROCF25 4RETURN5 edited FIND command is executed 3 94 QUERY V COMMANDS ...

Страница 131: ...ed by the SETLOCKS command If the command is entered while the SETLOCKS command is not in e ect you will receive the following message SETLOCKS COMMAND WAS NOT IN EFFECT When data set locks are released LOCKOPTION OFF overridden by the SETLOCKS command will take e ect with the same value it had prior to the SETLOCKS command QUERY V COMMANDS 3 95 ...

Страница 132: ...w procedure name is the name you want to use for the procedure in the future Refer to the CREATE command for naming rules Discussion Both procedure names must follow the rules de ned in the CREATE command description An error message is printed if old procedure name does not refer to an existing procedure in the current Proc le PROC FILE PROCACCT DISPLAY LIST FINDACCT FINDSALE UPCUST REPACCT REPSA...

Страница 133: ...separate lines or on one line separated by semicolons Discussion If you enter REPORT without following it with report statements QUERY will prompt you for the statements until you enter an END at the prompt If the rst report statement is in error the REPORT command terminates The REPORT command is an extension of a retrieval command in that it prints a report of the data entries located by the las...

Страница 134: ...c into values printed in the report These options are described in Table 3 6 Table 3 6 REPORT Statement Parameters PARAMETER FUNCTION APPLICABLE STATEMENTS print position determines the rightmost print position column number for the print element For character data this is the rightmost character for numeric data it is the position of the least signi cant digit Header Detail Group Total SPACE A nu...

Страница 135: ...he page number HEADERS are usually used to describe the report columns The report body consists of DETAIL lines GROUP TITLES and TOTALS along with other descriptive labels Normally each detail line displays information from a single data entry although information can appear on more than one line per entry A DETAIL eld can be edited to include commas decimal points dollar signs and other punctuati...

Страница 136: ... DETAIL DETAIL DETAIL DETAIL DETAIL DETAIL DETAIL SUBTOTAL SUBTOTAL SUBTOTAL GRANDTOTAL GRANDTOTAL GRANDTOTAL Figure 3 7 General Report Format Through the following sections on REPORT Statements a report is created by adding one statement type at a time and showing how the added statements change the report Figure 3 8 contains the nal version of the report 3 100 QUERY V COMMANDS ...

Страница 137: ...3 477 666 95 BAY PAPER CO 7391Z22F 12 01 85 4 704 00 CARDINAL MILLS 5405T14F 11 28 85 1 396 00 JAKE S JUNK 3739A14F 12 15 85 1 189 32 BIN TOTAL 553 485 956 27 2 ACME WIDGET 4397D13P 3 02 85 55 080 00 CARDINAL MILLS 3586T14Y 11 20 85 358 56 BIN TOTAL 55 438 56 3 ACME WIDGET 6650D22S 12 03 85 75 716 62 H S SURPLUS 6650D22S 12 14 85 187 85 6650D22S 12 15 85 153 45 BIN TOTAL 75 057 92 TOTAL INVENTORY ...

Страница 138: ... a simple item or a compound item with an optional subscript parameter The value of the speci ed data item is printed The data item can be quali ed with the data base and data set to which it belongs The form is 2 data base name 3 data set name dummy data set name data item name 2 subscript 3 dummy data set name is a temporary data set name used in multiple data set access refer to the JOIN comman...

Страница 139: ...or more information on overpunch F ALL INVENTORY STOCK USING SERIAL READ 13 ENTRIES QUALIFIED REPORT H1 AS OF 6 H1 DATE 15 H1 PAGENO 71 H1 PAGE 69 H2 BOBO S MERCANTILE 45 H3 ON HAND INVENTORY 45 SPACE A2 H7 BIN 4 H7 SUPPLIER 14 H7 STOCK 33 H7 SHIP DATE 49 H7 INVENTORY 68 H8 AMOUNT 68 In the example above entries are located rst Then report statements are entered describing the report headings Char...

Страница 140: ...h the same number are printed on the same line Information from a single data entry can therefore be printed on up to one hundred separate lines print element 1 is a simple data item name or a compound data item name with an optional subscript parameter When a data item is speci ed its value is printed for each entry reported A data item can be quali ed with the data base and data set to which it ...

Страница 141: ...TORY 45 SPACE A2 H7 BIN 4 H7 SUPPLIER 14 H7 STOCK 33 H7 SHIP DATE 49 H7 INVENTORY 68 H8 AMOUNT 68 D1 STOCK 36 D1 LASTSHIPDATE 48 END If the same report shown in the header statement example has detail statements added the result follows The rst detail statement prints the value of STOCK ending in column 36 The next statement prints LASTSHIPDATE value on the same detail line ending in column 48 Not...

Страница 142: ...s and any other ASCII alphanumeric printing characters used as insertion characters QUERY examines the data item value speci ed in the detail group or total statement and the edit mask speci ed in the referenced edit statement starting with the leftmost character of each If the character in the edit mask is X a character from the data item value is printed in the corresponding position of the outp...

Страница 143: ...nting the sign characters in the combinations outlined in Table 3 8 If the number of signi cant digits of the data item value is greater than the number of place holders 9 Z in the edit mask the output eld is lled with asterisks For example if the value 12345 is edited with the mask 999CR the result is Only one decimal point can appear in any edit mask If a minus sign appears in the edit mask in a...

Страница 144: ...he output eld 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 rst two rightmost positions of the output eld 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 rst two rightmost po...

Страница 145: ...9 99 99 9999 99CR 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 Figure 3 9 Sample Output Using Numeric Edit Masks Real Numbers Real values can be printed in either xed point xx xxx or oating point xx xxxExx form The default is t...

Страница 146: ...R2 R2 ZZZZZ9 ZZZZZZ 999999 9999999 0 839610 123456 0034567 Rounding di erence For this number to come out as 8399607 it must be R4 precision Example REPORT H1 AS OF 6 H1 DATE 15 H1 PAGENO 71 H1 PAGE 69 H2 BOBO S MERCANTILE 45 H3 ON HAND INVENTORY 45 SPACE A2 H7 BIN 4 H7 SUPPLIER 14 H7 STOCK 33 H7 SHIP DATE 49 H7 INVENTORY 68 H8 AMOUNT 68 D1 STOCK 36 D1 LASTSHIPDATE 48 E2 user E2 XX XX XX END In th...

Страница 147: ... not de ne a control break data item name is the name of a simple data item or a compound data item with an optional subscript parameter that is contained in data entries selected by the last retrieval command If you used a FIND CHAIN to retrieve entries use a master data item in the sort statement It can also be quali ed with the data base and data set to which it belongs The form is 2 data base ...

Страница 148: ...ITE ROB 26 WHITE LARRY 81 WHITE WILL 22 The higher numbered sort statement identi es the major or rst sort eld while the lower numbered sort statement identi es the minor sort eld The minor sort arranges entries in the order speci ed keeping all major sort items with identical values together in other words it sorts within subsets of the entire set of entries S1 F NAME S2 L NAME If the statements ...

Страница 149: ... F NAME A group or total statement prints only when a control break occurs that is at the same level as the group or total statement This means that a total statement labeled T1 prints only when a level 1 control break occurs or a group statement labeled G2 prints only when a level 2 control break occurs Consult the descriptions of group and total statements later in this section for an explanatio...

Страница 150: ...IPDATE 48 E2 E2 XX XX XX S2 BINNUM S1 SUPPLIER S LASTSHIPDATE END In the example above BINNUM is de ned as a sort level 2 SUPPLIER as sort level 1 and LASTSHIPDATE as a sort without a control break As shown in the new report the detail entries are now sorted by BINNUM SUPPLIER and LASTSHIPDATE The values for BINNUM and SUPPLIER will be printed in group statements which are described next AS OF 01 ...

Страница 151: ...onal subscript parameter Data items can be quali ed with the data base and data set to which they belong The form is 2 data base name 3 data set name dummy data set name data item name 2 subscript 3 dummy data set name is a temporary data set name used in multiple data set access Refer to JOIN command subscript is a number indicating which sub item to access Subscript is entered in parenthesis and...

Страница 152: ...st position unless you use the NOPUNCH output control statement This type of output is called overpunch Refer to the REPORT ALL command for more information on overpunch REPORT H1 AS OF 6 H1 DATE 15 H1 PAGENO 71 H1 PAGE 69 H2 BOBO S MERCANTILE 45 H3 ON HAND INVENTORY 45 SPACE A2 H7 BIN 4 H7 SUPPLIER 14 H7 STOCK 33 H7 SHIP DATE 49 H7 INVENTORY 68 H8 AMOUNT 68 D1 STOCK 36 D1 LASTSHIPDATE 48 E2 XX XX...

Страница 153: ... STATEMENTS The total statement prints a data item value the value in a register Rn a series of characters or the total average or count of a group of data items whenever a control break occurs Syntax Tlevel print element print position 2 SPACE A 2 number 3 3 2 SPACE B 2 number 3 3 SKIP A B E number Z 2 4 8 ADD AVERAGE COUNT 9 2 NOREPEAT 3 3 5 Or the special form Tlevel Rn For example T4 WAGES 60 ...

Страница 154: ...the quotation marks but QUERY will strip them when it prints the characters ADD prints the control group total of the values for the data item speci ed 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 speci ed as the print element The print element must be the name of a numeric type data item COUNT prin...

Страница 155: ... on the same data item you must specify a total statement for each operation The information is printed on the same line if you use the same level for each statement No more than ve 5 data items can be used as print elements in total statements REPORT H1 AS OF 6 H1 DATE 15 H1 PAGENO 71 H1 PAGE 69 H2 BOBO S MERCANTILE 45 H3 ON HAND INVENTORY 45 SPACE A2 H7 BIN 4 H7 SUPPLIER 14 H7 STOCK 33 H7 SHIP D...

Страница 156: ...S 12 14 85 6650D22S 12 15 85 BIN TOTAL TOTAL INVENTORY The NOREPEAT Option The NOREPEAT option is only applicable on compound data sets created by a MULTIFIND command In a compound data set a particular value can occur more than once This is because each value of the data item on the left side of the TO of the JOIN command is being paired with each occurrence of that value of the data item on the ...

Страница 157: ...STOCK 60 in SALES DETAIL resulting in 3 entries in the compound data set You can see by the ACCT that each of these entries is separate and unique Now suppose you wanted to produce a report from this retrieval in which you wanted to count the number of STOCK in the entries retrieved The report might look like REPORT H1 DIFFERENT STOCK COUNT 30 TF STOCK DETAIL STOCK 50 COUNT END This report would p...

Страница 158: ...und data item with an optional subscript parameter Data items may be quali ed with the data base and data set which they belong The form is 2 data base name 3 data set name dummy data set name data item name 2 subscript 3 dummy data set name is a temporary data set name used in multiple data set access Refer to the JOIN command subscript is a number indicating which sub item to access Subscript is...

Страница 159: ...ains 2 After the statement below is executed R2 MULTIPLY R4 R2 will contain 6 Using QUERY Registers The register statements in a REPORT command describe a xed sequence of operations to be performed each time a new data entry is processed for the report If you are familiar with programming techniques you can consider the Rn statements as a program loop which is executed once for each entry in the r...

Страница 160: ... content of R2 will be type real R2 L 3 R2 M PERCENT where the value of PERCENT is 25 6 All registers start with a default type of packed decimal When you issue the REPORT command QUERY cycles through all register statements before executing the command and assigns each register the highest type that the register will hold during the report This ensures the correct typing of a register in case its...

Страница 161: ...out the order of precedence and its e ect on the calculations For example if you operate on a real register number with an integer having 12 signi cant digits the result will have 6 to 7 signi cant digits Numeric Literals To use a constant number in a register operation you enter the number surrounded by quotation marks for example 325 0013 3E 6 This type of number is called a numeric literal Inte...

Страница 162: ...ts are added to print the content of Register 8 at each level 2 control break to clear Register 8 and to print the content of Register 9 on the nal total line The last register statement adds R12 to R9 each time the data of another entry is printed in the report In this example all register statements are executed every time a new entry is processed by the REPORT command AS OF 01 07 86 PAGE 1 BOBO...

Страница 163: ...ach 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 4RETURN5 to continue PAUSE adds an extra line as 4RETURN5 is pressed PAUSE is ignored in job...

Страница 164: ...is terminated with 4CONTROL5 Y When the NOPAGE output control statement is used QUERY does not skip lines for a top of page margin F ALL LAST NAME USING SERIAL READ 13 ENTRIES QUALIFIED REPORT ALL ACCOUNT 54283540 LAST NAME CORCORAN FIRST NAME CLIFFORD INIT 4CONTROL5 Y CONTROL Y REPORT NOPAGE ALL ACCOUNT 5428340 LAST NAME CORCORAN FIRST NAME CLIFFORD INITIAL C In the example below QUERY pauses aft...

Страница 165: ...REPORT G1 GROUP TITLE 11 END QUERY V COMMANDS 3 129 ...

Страница 166: ...ype P or Z and positive values of type Z are printed with an overpunch character Refer to the next page for more information on overpunch Discussion The REPORT command prints a report of the data entries located by the last FIND MULTIFIND or SUBSET command REPORT output can be directed to any desired output device through the MPE FILE command and the QUERY OUTPUT command Refer to the OUTPUT comman...

Страница 167: ...varies according to the rightmost digit in the value Table 3 10 shows the overpunch characters For example the number 104 is represented as 10M in QUERY Table 3 10 Overpunch Characters RIGHTMOST DIGIT IN VALUE POSITIVE REPRESENTATION NEGATIVE REPRESENTATION 0 1 2 3 4 5 6 7 8 9 may vary with terminal A B C D E F G H I may vary with terminal J K L M N O P Q R Table 3 11 shows the representation of P...

Страница 168: ...ND Z4 TYPES ITEMNAME 55 ITEMNAME 55 ITEMNAME 55 Examples Example 1 FIND ALL LAST NAME USING SERIAL READ 13 ENTRIES QUALIFIED REPORT ALL ACCOUNT 54283540 LAST NAME CORCORAN FIRST NAME CLIFFORD INITIAL C STREET ADDRESS 6105 VALLEY GREEN DR CITY CARMEL STATE CA ZIP 93921 As shown in the example above once entries have been found REPORT ALL prints the value for each item to which you have access Examp...

Страница 169: ...ILLIAM 4CONTROL5 Y CONTROL Y When REPORT ALL is used with a character the data values are printed without the data item names and data set names You can terminate the report at any time by entering 4CONTROL5 Y QUERY V COMMANDS 3 133 ...

Страница 170: ...s not been declared QUERY prints an error message Before the procedure is executed QUERY checks it for proper syntax If any statement except the rst one is incorrect QUERY issues an error message and prompts you with At this point you can enter one or more statements to replace the statement causing the error The statements must be on one line and separated by semicolons If any of these substitute...

Страница 171: ...es For example you might respond with REPORT REP4 003 S1 STOCK EXPECTED A S1 STOCK S LASTSHIPDATE Not only has the sort statement been temporarily xed but another sort statement has been added as well Once the procedure has executed the corrections and additions are lost When using REPORT procedures you can leave out END When the procedure is executed QUERY will prompt you for the missing END You ...

Страница 172: ...n and the select le is not saved QUERY s internal select le consists only of record numbers However when you use the SAVE command the data from the entries that quali ed when the retrieval command was executed is copied into the le This le can then be used by other subsystems such as DSG 3000 The select le and the data in the database remain unchanged by the SAVE command Saving Multiple Data Set S...

Страница 173: ...bove locking takes place when the FIND command is entered and will remain in e ect until a RELEASE command is entered After a SETLOCKS command has been issued QUERY provides a warning prompt following every command If you enter a SETLOCKS command a second time you will receive the following message SETLOCKS COMMAND ALREADY IN EFFECT Locks incurred by any QUERY command following a SETLOCKS command ...

Страница 174: ...t valid JOIN command if any LOCKOPTION shows the current state of LOCKOPTION which can be reset with the ASSIGN command LANGUAGE is the user language Refer to the LANGUAGE command and Appendix D for more information data base name is the name of a data base opened with a MULTIDB command If a name is not speci ed QUERY will use the primary data base de ned by the DEFINE or DATA BASE command SHOW LO...

Страница 175: ... temporary data set name used in multiple data set access refer to the JOIN command data item name is the name of a data item contained in the data base If a data set name is used the data item must belong to the speci ed data set To use the MATCHING option the data item must be type X or U subscript is a number indicating which sub item to access Subscript must be an integer 1 and the number of s...

Страница 176: ...a items named in the SUBSET command must belong to the data set s accessed in the most recent FIND or MULTIFIND command Up to 50 logical connectors AND OR can be used in a SUBSET command Refer to Logical Connectors under the FIND command When the SUBSET command is entered the current select le is saved as a temporary le which can be restored and made accessible through the use of the UNDO command ...

Страница 177: ...S SUBSET PERIODICAL YEAR 85 SAVE MFILE In the example above the SUBSET command only searches those entries that quali ed from the FIND command The SAVE command saves entries from the current select le as a permanent le named MFILE QUERY V COMMANDS 3 141 ...

Страница 178: ...character is any printable ASCII character If character is included in the command the SUBSET procedure is printed on the standard list device before executing Discussion QUERY searches the current Proc le and executes the procedure named in the command If the Proc le has not been declared or the procedure does not exist in the Proc le or the procedure is incorrect in some way you are informed by ...

Страница 179: ...ctions in the event of a system failure Marking the transaction with a TRANSBEGIN and TRANSEND allows you to restore your data base to a consistent state by suppressing those transactions that failed to complete For further information on transaction logging refer to the IMAGE Reference Manual Logging must have already been enabled from the IMAGE subsystem for the TRANSBEGIN command to work Consul...

Страница 180: ...similar manner to the IMAGE DBEND intrinsic A transaction is de ned as a sequence of one or more modi cations which changes a data base from one consistent state to another Logging allows you to keep a record of transactions in the event of a system failure Marking the transactions with a TRANSBEGIN and TRANSEND enables you to restore your data base to a consistent state by suppressing those trans...

Страница 181: ...ssage is logged against the data base opened with the DEFINE or DATA BASE command text is a character string to be written to the log le Discussion This command allows you to write a message to the log le that adds additional information or that identi es transactions in the event of a system failure and subsequent recovery A message can be added at any time but can be no more than 512 characters ...

Страница 182: ...previous SUBSET FIND or MULTIFIND command but UNDO must follow a SUBSET command After each SUBSET retrieval QUERY prints the number of quali ed entries retrieved Examples Example 1 FIND ALL PERIODICAL JOURNAL USING SERIAL READ 60 ENTRIES QUALIFIED SUBSET PERIODICAL JOURNAL CALIFORNIA 30 ENTRIES QUALIFIED UNDO In this example the previous 60 entries are in the current select le again Example 2 FIND...

Страница 183: ...ommand Discussion When you use the UPDATE ADD command QUERY prompts you for data item values by printing the names of the data items You type the desired value following the data item name QUERY will continue to prompt you for data item values until you terminate the command In a procedure you must use the UPDATE ADD form of the command UPDATE can be abbreviated ADD cannot be abbreviated when it i...

Страница 184: ...MIDWEST SALESPERSON Using Quotation Marks Values can be entered with or without quotation marks When you enter U or X type values without quotation marks leading blanks are ignored and the value is left justi ed in the data item eld Blanks or any other special characters are entered in the data eld only if the value is entered with quotation marks For example if F NAME is a U type data item then F...

Страница 185: ...aster set before you can add entries to the detail data set Each detail entry is associated with a master entry through the same search item The detail search item and the master search item must have the same value and the value must exist in a master entry before it can be added to a detail data entry If you enter a search item value that does not exist in the master data set linked to the detai...

Страница 186: ... dates are automatically added to the DATE MASTER automatic master data set ADD SALES ACCOUNT 86110047 STOCK 14519990 QUANTITY 6 PRICE 2000 TAX 4RETURN5 TOTAL 4RETURN5 PURCH DATE 121585 DELIV DATE 121685 MISSING SEARCH KEY VALUE FOR ACCOUNT IN MASTER CUSTOMER ENTRY CANNOT BE ADDED ACCOUNT ADD CUSTOMER ACCOUNT 86110047 LAST NAME CELERY FIRST NAME ALLISON INITIAL B STREET ADDRESS 18 ASCOTT AVE CITY ...

Страница 187: ...Y deletes the entries If you respond NO the command is ignored and you are prompted for another command In job mode the entries are deleted without con rmation In a procedure you must use the UPDATE DELETE form of the command UPDATE may be abbreviated DELETE may not be abbreviated when using it with the UPDATE keyword You must have speci ed a mode of 1 3 or 4 in order to use this command Master Da...

Страница 188: ...NT value of 07954001 so QUERY will not delete the entry from the CUSTOMER master data set Next an entry with an ACCOUNT equal to 07954001 is deleted from the SALES detail data set Now the ACCOUNT equal to 07954001 in the CUSTOMER master data set can be deleted 3 152 QUERY V COMMANDS ...

Страница 189: ...e previous retrieval command All of the data entries selected must be from the same set UPDATE REPLACE can only be used following a FIND or FIND ALL command or a SUBSET command following a FIND or FIND ALL command Entering a FIND CHAIN or MULTIFIND command which selects entries from a detail set and one or more master data sets followed by an UPDATE REPLACE command is not allowed You must have spe...

Страница 190: ...ne record or several consecutive records If an error occurs either illegal data or an IMAGE error QUERY will terminate Null Values You can store an UPDATE REPLACE command as a procedure with null values for the data items You do this by entering a pair of quotation marks with no intervening characters data item name for example DATE When such a procedure is executed using the UPDATE procedure name...

Страница 191: ... 4RETURN5 TOTAL 4RETURN5 PURCH DATE 121585 DELIV DATE 121685 ACCOUNT F SALES ACCOUNT IS 67795400 1 ENTRIES QUALIFIED UPDATE REPLACE TAX 25 TOTAL 1825 END The UPDATE REPLACE command can also be used to ll in blank values In the second example no values are entered for TAX and TOTAL when the entry is added The UPDATE REPLACE command is then used to add these values after the entry has been located w...

Страница 192: ...REPORT ALL is used to verify the replacements The entries are still available from the last FIND Each PRODUCT data set entry with a STOCK greater than 70000000 is changed so that the description is OBSOLETE 3 156 QUERY V COMMANDS ...

Страница 193: ...o the CREATE command for information on creating a procedure When you execute the UPDATE procedure QUERY rst checks each line of the procedure If an error occurs a message is sent and the incorrect statement in the line is ignored All other correct statements in the procedure are executed If the character is included in the command the procedure is listed before the execution begins Example F LAST...

Страница 194: ...UPDATE procedure END When using null values QUERY prompts for values when the procedure is executed 3 158 QUERY V COMMANDS ...

Страница 195: ...ously the information is also printed on the QSLIST device Refer to the OUTPUT command for a description of QSLIST VERSION QUERY C 00 08 IMAGE PROCEDURES DBOPEN C 0A 16 DBINFO C 00 17 DBCLOSE C 00 12 DBFIND C 00 15 DBGET C 00 15 DBUPDATE C 00 15 DBPUT C 00 15 DBDELETE C 00 15 DBLOCK C 00 16 DBUNLOCK C 00 16 BIMAGE C 00 16 IMAGE PROGRAM FILES DBSCHEMA PUB SYS C 00 10 DBSTORE PUB SYS C 00 00 DBRESTO...

Страница 196: ... If an error occurs while opening the data base in session mode QUERY will close the XEQ le and prompt for another command In job mode QUERY closes the XEQ le and the job is terminated An XEQ command within another XEQ le will close the rst le and open the new one The initial le is never reopened QUERY performs an end of le on the rst le and control transfers to the new le The NODATA option speci ...

Страница 197: ... records DEFINE ORDERS CLERK 5 CUSTOMER SALES PROCX TERM QUERY executes the DEFINE command and uses the other records as data in response to the DEFINE command prompts If the NODATA option had been speci ed QUERY would prompt you for each DEFINE prompt XEQ FISET DEFINE DATA BASE ORDERS PASSWORD CLERK MODE 5 DATA SETS CUSTOMER SALES PROC FILE PROCX OUTPUT TERM OUTPUT TERM END OF XEQ FILE Example 2 ...

Страница 198: ...ed directly from the le XEQ NODATA would prompt you for report statements instead of reading them from the le Therefore the REPORT command is stored as a procedure BILL in the current Proc le and is initiated from PRXFIL after the FIND CHAIN command The procedure BILL contains REPORT H1 BOBO S MERCANTILE 43 SPACE A4 H2 ACCOUNT 10 H2 ACCOUNT 14 H2 BILLING DATE 60 SPACE A2 H2 DATE 70 H3 FIRST NAME 1...

Страница 199: ...XEQ TF TOTAL DUE 9 SPACE B2 SKIP A TF R0 70 E2 S PURCH DATE END QUERY V COMMANDS 3 163 ...

Страница 200: ......

Страница 201: ...KIP options can be used with user procedures Correct the command and re enter it A TRANSACTION IS IN PROGRESS TRANSEND MUST BE CALLED BEFORE ANOTHER TRANSBEGIN TRANSBEGIN was entered twice without any intervening TRANSEND Another transaction cannot be started until the preceding transaction has ended Enter TRANSEND if you want to end the current transaction ADD OPTION ALREADY SPECIFIED The ADD opt...

Страница 202: ...M The UPDATE REPLACE command has attempted to modify a data item to which you have only read but not write access You cannot modify the item unless you supply the appropriate password with the PASSWORD command AUTOMATIC MASTER The UPDATE ADD command has attempted to add an entry to an automatic master data set It is not necessary to explicitly enter values for an automatic master IMAGE will do tha...

Страница 203: ...ACE the command terminates Use the FORM command to see the exact length of the data items and re enter the values CAN ONLY REPORT FROM DATA BASE USED IN FIND OR SUBSET COMMAND A data base other than the one speci ed in the FIND or SUBSET command was speci ed in your report Correct the data base name and re enter the command CAN ONLY RETRIEVE FROM ONE DATA BASE AT A TIME FOLLOWING A FIND COMMAND A ...

Страница 204: ...data type the other data item named in the equivalence must also be of character type Use the FORM command to check the type of data items COMBINED LENGTH OF DATA ENTRIES FORMING A COMPOUND ENTRY CANNOT EXCEED 2047 WORDS The select le may not be saved since the length of the compound data entry is too large None COMMAND STOPPED AT LIMIT AS SPECIFIED Command has retrieved the number of entries spec...

Страница 205: ...OUNT option has been entered twice for the same total statement Re enter the statement with a single COUNT option COUNT OPTION NOT ALLOWED IN STATEMENT Statement other than total contains a COUNT option Re enter the statement without COUNT DATA BASE data base name HAS BEEN CLOSED COMMAND CANNOT BE CONTINUED The data base that your command refers to has been closed Either enter another command that...

Страница 206: ...ta base at a later time DATA BASE NOT DECLARED The command has been entered prior to declaring the data base s Use DEFINE DATA BASE or MULTIDB to declare the data base s DATA BASE OPEN EXCLUSIVELY The data base is currently being accessed by another user with exclusive access mode Wait until the other user closes the data base and try again DATA BASE OPEN IN ANOTHER MODE The data base is currently...

Страница 207: ...e value See Table 1 1 for the legal value range for type K DATA SET BUSY TRY AGAIN The data set is being accessed by other users Try again later DATA SET FULL No more entries can be added to the data set Consult with your data base administrator DATA SET NOT WRITEABLE The command attempted to modify a data item in a data set which you are only allowed to read but not write You must supply an appro...

Страница 208: ...ontact your HP support representative DIRECTORY OVERFLOW PROCEDURE REJECTED The current Proc le directory is full and cannot accept more procedures Delete existing unused procedures in the current Proc le or build and declare another one with the PROC ENTITY command DUPLICATE EDIT STATEMENTS More than one edit statement with the same number has been entered The second edit statement is ignored unl...

Страница 209: ...reference Revise the statement and re enter it EDIT OPTION ERROR The edit statement reference is not between E0 and E9 inclusive Revise the statement and re enter it EDIT OPTION NOT ALLOWED IN STATEMENT The edit statement is referenced in the displayed statement which contains a literal as a print element Revise the report and re enter the command EITHER NO JOIN COMMAND WAS ISSUED OR THE MOST RECE...

Страница 210: ...nt is greater than the nal statement number of the procedure being altered Re enter the command with the correct statement number x ENTRIES HAVE QUALIFIED DO YOU WANT TO CONTINUE SEARCHING 4CONTROL5 Y was entered during the retrieval x is the number of entries found so far Reply NO if you want to terminate the command The number of entries that have quali ed so far will be preserved Reply YES if y...

Страница 211: ...QUERY Problem Item n is the number of the item in error Contact your HP support representative ERROR IN SAVE PROCEDURE INVALID ITEM TYPE SPECIFIED ITEM n Internal QUERY Problem Item n is the number of the item in error Contact your HP support representative ERROR IN SAVE PROCEDURE ITEM BOUNDARY TOO LONG FOR RECORD ITEM n Internal QUERY Problem Item n is the number of the item in error Contact your...

Страница 212: ...emicolon is missing from the command or statement Correct the command or statement and re enter it EXPECTED A CHARACTER IN PATTERN A pattern must have one or more characters Correct the command or statement and re enter it EXPECTED A CONNECTOR OR END The command is missing a logical connector AND or OR or a terminating END or an ending quote is missing from a data item value Correct the command or...

Страница 213: ...RMINATED An unrecoverable error has occurred Notify your data base administrator FCLOSE FAILURE x y The MPE intrinsic FCLOSE failed IMAGE error 2 x is the data set number y is the le system error number Notify your data base administrator FILE CLOSE ERROR code A le error occurred while MPE was closing a le Code is an MPE le system error number Notify your data base administrator FILE DOES NOT EXIS...

Страница 214: ...correct procedure name Re enter the command FLOCK FAILURE x y The MPE intrinsic FLOCK failed IMAGE error 7 x is the data set number y is the le system error number Notify your data base administrator FOPEN FAILURE x y The MPE intrinsic FOPEN failed IMAGE error 1 x is the data set number y is the le system error number Notify your data base administrator FREADDIR FAILURE x y The MPE intrinsic FOPEN...

Страница 215: ... Notify your data base administrator FWRITELABEL FAILURE x y The MPE intrinsic FOPEN failed IMAGE error 6 x is the data set number y is the le system error number Notify your data base administrator HEADERS OVERFLOW A PAGE The Header Statements print more header lines of information counting line skipping than can t on one output page Revise the Header Statements and re enter the command ILLEGAL A...

Страница 216: ... data type speci ed in a register statement is de ned as U or X or a register number is outside the range 0 29 Revise the register statement and re enter it ILLEGAL DUMMY DATA SET NAME A dummy data set name cannot be longer than 16 characters and the rst character must be alphabetic Correct the command and re enter it ILLEGAL ITEM LENGTH x FOR ITEM item name The referenced data item is not the pro...

Страница 217: ...mmand with correct name Refer to the MPE Commands Reference Manual for valid le names ILLEGAL PROCEDURE NAME The speci ed procedure name contains non alphanumeric characters Re enter procedure name without non alphanumeric characters ILLEGAL REGISTER OPERATOR The operator speci ed is not one of the valid register operators Refer to the Register Statement under the REPORT command for valid operator...

Страница 218: ...ing line number greater than ending statement number for example R 5 3 Beginning line number referenced in statement less than ending line number of previous statement for example R 2 4 D 3 Alter statement does not start with I R D or E Illegal character entered Re enter the statement correctly R or I entered with no additional lines for example R 4 D 6 CREATE Input line contains an illegal charac...

Страница 219: ...intervening OUTPUT TERM The command is ignored the second time it is entered Refer to the command description for the proper format and re enter the command INVALID CHARACTERS AFTER DELETE COMMAND The D subcommand can only be followed by other D s or by the insert I subcommand Enter a valid editing subcommand INVALID CHARACTERS AFTER EDIT COMMAND A subcommand of the REDO command is followed by inv...

Страница 220: ...r the command with a valid password INVALID RANGE FOR COMMAND HISTORY BUFFER The speci ed range does not exist in the command history bu er Use LISTREDO to list all the commands then re enter the command with a valid range of command numbers INVALID RELATIONAL OPERATOR An invalid relational operator has been entered Refer to Table 3 1 then re enter the command with a correct operator INVALID SUB I...

Страница 221: ...rent subcommand LOGICAL CONNECTIONS ARE INCOMPLETE COMPOUND DATA SET CANNOT BE GENERATED It must be possible to trace the data item equivalence from one data set to every other data set named in the JOIN command Refer to the JOIN command for more information Correct the command and re enter it LOGGING ENABLED AND NO LOG PROCESS RUNNING Logging may have been enabled in DBUTIL for the speci ed data ...

Страница 222: ...e name MUST OPEN THE FIRST DATA BASE WITH EITHER THE DEFINE COMMAND OR THE DATA BASE COMMAND The MULTIDB command may only be used after the primary data base is open Use the DEFINE or DATA BASE command to open the primary data base then re enter the command MUST SPECIFY BOTH DATA BASE NAME AND DATA SET NAME IN USER DEFINED PROCEDURE If the data base name is speci ed in a user procedure then the da...

Страница 223: ...WAS MADE FROM DATA BASE data base name WHICH WAS NAMED IN A USER PROCEDURE The data base speci ed is not the name of a currently opened data base Correct the data base name in your user procedure recompile and store into the proper SL NO RETRIEVAL WAS MADE FROM DATA SET data base name data set name The FIND MULTIFIND or SUBSET command did not access this data set Enter another FIND MULTIFIND or SU...

Страница 224: ...termine the correct procedure name Re enter the command NOT A SUBSET PROCEDURE The referenced procedure does not contain a SUBSET command Use DISPLAY or DISPLAY LIST to determine the correct procedure name Re enter the command NOT A REPORT PROCEDURE The referenced procedure does not contain a REPORT command Use DISPLAY or DISPLAY LIST to determine the correct procedure name Re enter the command NO...

Страница 225: ...owable 20 characters Revise the edit mask and re enter the statement NUMERIC VALUE ERROR or NUMERIC VALUE ERROR ITEM IGNORED ALTER DISPLAY A line number contains too many digits or an illegal character Re enter the statement or command with the correct line number LIST UPDATE A numeric value contains an illegal character or is larger than allowed for the data type Re enter the command with the cor...

Страница 226: ...or correct the command syntax PROCEDURE NAME TOO LONG The name of the procedure is more than eight characters Re enter the command with a valid procedure name PROC FILE BUSY The Proc le is currently being accessed by another user The command using the Proc le is ignored Try again later PROC FILE BUSY DO YOU WISH TO WAIT YES OR NO The Proc le is being accessed by another user In batch mode the defa...

Страница 227: ...or occurred while reading from the le used for input to QUERY Check the input device and try entering the command again Consult with the system manager REAL VALUE ERROR ITEM IGNORED Real value contains an illegal character or is not in the proper range for the data item de ned Refer to Section 1 for data item types and ranges Re enter the command with a correct value RECORD HAS NOT YET BEEN FOUND ...

Страница 228: ...nd SAME LINES HAVE CONFLICTING REPORT OPTIONS label A statement option has appeared more than once in statements concerning the same report line Label is the statement type and level Revise the necessary statements and re enter the command SCRATCH FILE 8 READ OPEN WRITE 9 ERROR code A physical error has occurred during QUERY access of a scratch le The le is not accessible to the user Code is the l...

Страница 229: ...lf of QUERY Message is the SORT 3000 error message Refer to the SORT 3000 Reference Manual and try the command again SORT LEVEL MISSING OR DUPLICATE label The group or total statements reference sort statements which either do not exist or appear twice in the REPORT command For example S1 appears twice or a total statement is labeled T3 when no S3 statement exists Label is the statement type and l...

Страница 230: ... speci cations or use another le name SPECIFIED FILE HAS MULTIRECORD ACCESS CHECK FOR FILE EQUATE The le named in the SAVE command cannot have multirecord access Correct the le equate refer to Appendix G for SAVE le speci cations or use another le name SPECIFIED FILE HAS NOBUF CHECK FOR FILE EQUATE The le named in the SAVE command cannot have NOBUF Correct the le equate refer to Appendix G for SAV...

Страница 231: ...FER TOO SMALL Internal QUERY problem Contact your HP support representative TEXT MUST BE NO GREATER THAN 512 CHARACTERS The memo on the log le cannot exceed 512 characters Re enter the log le memo THE DATA BASE data base name NAMED IN THE USER PROCEDURE IS ILLEGAL The speci c data base is either an illegal name or is not the name of a currently open data base Correct the data base namein your user...

Страница 232: ...o Section 3 under the JOIN command for more information Correct the command and re enter it THE SIGN IS NOT ALLOWED ON BOTH SIDES OF THE TO There can only be one per data item equivalence Correct the command and re enter it THIS COMMAND HAS GONE OVER THE LIMIT OF 260 064 ENTRIES 260 064 ENTRIES HAVE BEEN KEPT Only 260 064 entries can be selected as a result of a single FIND or MULTIFIND command Re...

Страница 233: ...with a different name UNDO COMMAND NOT ALLOWED NOW The UNDO command is only allowed following a SUBSET command Refer to the SUBSET command for correct usage UNEXPECTED ERROR IN REPORT PRINT REPORT COUNT TABLE FULL Internal QUERY problem Contact your HP support representative UNIFYDETAIL MAY NOT BE USED HEADER AND DETAIL SPACE DOES NOT FIT ON ONE PAGE The header and detail lines will not all t on o...

Страница 234: ...lete the search or terminate the command with 4CONTROL5 Y WARNING LOCKS ARE BEING HELD SETLOCKS has been entered and there are locks in e ect that will remain until RELEASE is entered If you do not need to retain these locks enter a RELEASE command since other users may want to access the locked data set s WHAT IS THE VALUE OF item name The command contains a null data item value You are prompted ...

Страница 235: ...f Input Line 698 characters Table B 2 JOIN Command TYPE MAXIMUM Length of Dummy Data Set Name 16 characters Number of Data Item Equivalences 52 Number of Data Sets in JOIN 53 Table B 3 LIST Command TYPE MAXIMUM LIST Literals 768 total characters LIST Logical Connectors 10 Table B 4 PROC FILE Command TYPE MAXIMUM ALTER Command Input Line 250 characters Number of Procedures in a Proc le Refer to PRO...

Страница 236: ... 136 characters Sort Levels 1 9 Sort Statements 66 unnumbered Total Statement Data Items 5 Total Levels 1 10 and TF Total Number of REPORT Statements 400 Table B 6 Retrieval Command FIND MULTIFIND SUBSET TYPE MAXIMUM FIND Chain Values 16 FIND MULTIFIND SUBSET Literals 12288 total characters FIND MULTIFIND SUBSET Logical Connectors 50 FIND MULTIFIND SUBSET Retrieval 260 064 entries Number of Patter...

Страница 237: ...s a temporary le which contains the command history bu er used by the LISTREDO and REDO commands QREDOF This is a temporary le which contains the command being edited with the REDO command QSCMPSEL A select le This is a temporary le which contains the record numbers of the compound data set entries which qualify from a MULTIFIND or SUBSET command QSKIB Holds the literal values speci ed in the FIND...

Страница 238: ...TIFIND or SUBSET command Cannot be built by you The le must be a new le You can specify a le equate Required File Attributes le code 1084 ASCII xed length records disc le required defaults NOCCTL NOMR BUF WAIT record size size in bytes of IMAGE entry le size number of entries to be saved Table B 13 Unnamed Scratch Files Temporary Files USED BY DESCRIPTION JOIN Used to hold the most recent JOIN com...

Страница 239: ...mer Reference Manual METHOD 1 QUERY ON REMOTE SYSTEM Method 1 is the most e cient since it minimizes communications line tra c You can log on to your local computer establish a communications link initiate a remote session and run QUERY on the remote system This method is illustrated in Figure C 1 A user whose user name is USERL and whose account is ACCTL logs on to the local system The user then ...

Страница 240: ...peci ed as the formal le designator in the FILE command Figure C 2 illustrates Method 2 using DS After USERL establishes a communications link and remote session on the remote system the user enters a le equation to specify that the data base DBR resides on a remote system with dsdevice name SYSR The device type may be omitted if the default device type is acceptable The user runs QUERY on the loc...

Страница 241: ...ed a FILE command specifying the remote location of the le to access a remote data base and run QUERY In the example above the user would enter HELLO USERL ACCTL DSLINE SYSR FILE DBR DBX SYSR REMOTE HELLO MEMBER PAYROLL RUN QUERY PUB SYS ACCESSING A REMOTE DATA BASE C 3 ...

Страница 242: ... on to the local system runs QUERY and speci es a data base access le name with the DATA BASE command The data base access le contains the name of a remote data base and the commands to establish a communications link and remote session to access the data base DBR that resides on the remote system Record 1 of the data base access le speci es the remote system on which the data base resides and the...

Страница 243: ...yntax for the DSLINE and FILE commands This is due in part to the IMAGE restriction on the size of the dsdevice name to 8 characters If you are using NS input the device class name or logical device number in the rst two records of the data base access le ACCESSING A REMOTE DATA BASE C 5 ...

Страница 244: ......

Страница 245: ...ple in a French data base with a QUERY user s language of Danish data items in a sorted chain might be retrieved according to the French collating sequence but the sorting or formatting is done according to Danish criteria The user can specify the QUERY user s language by Using an MPE command SETJCW NLUSERLANG langnum Default is NATIVE 3000 Using a QUERY command LANGUAGE langnum Default is NLUSERL...

Страница 246: ...rt the session in a batch mode Date Format DATE is a reserved word in the REPORT command which provides the system date It is formatted according to the user s language Real Number Conversions In the commands REPORT and LIST the output is formatted according to the user s language For example 123 45 in NATIVE 3000 becomes 123 45 in FRENCH Sorted Lists in REPORT QUERY sorts type U or X items in a R...

Страница 247: ...compound data set entry is the combined size of the entries in the single data sets of which it is comprised speci ed in the JOIN command The data in the le is stored in the same form as the data in the IMAGE data base Numeric data is stored in binary form and must be converted to ASCII before it can be displayed USER LABELS There are two types of user labels which both contain descriptive informa...

Страница 248: ...at created the le The standard HP version format is followed AA NN NN 8 characters right justi ed length is the length of the records in bytes This corresponds to the size of the IMAGE entry integer items is the number of items in each le record This corresponds to the number of items in the IMAGE entry integer labels is the number of item description user labels integer items labels is the number...

Страница 249: ...a single data set However entries retrieved with a MULTIFIND may have duplicate item names because they are retrieved from more than one data set The duplicate items must have been used in the JOIN data item equivalence s An exception is made because the duplicate items are of the same value although they may be of di erent data types The rst occurence of the item in the compound data set entry is...

Страница 250: ...bels items label size A 00 00 38 4 2 8 15 and the item description label contains name type offset length unused NAME 1 0 10 0 OCCUP 1 10 16 0 CITY 1 26 10 0 STATE 3 36 2 0 and the data in the le is binary data is represented as periods M FULLER ENGINEER CUPERTINO H THOREAU ENGINEER SAN DIEGO W EMERSON ENGINEER FT COLLINS G SAND TECH WRITER CUPERTINO Example 2 Compound Data Set Retrieval Given the...

Страница 251: ...1 STATE TO SET2 STATE MU STATE 2 OR STATE 3 USING SORT MERGE USING SERIAL READ 10 COMPOUND ENTRIES QULIFIED SAVE SAV2FILE the SD le SAV2FIL would look like this labels 0 9 item description label global information label data where the global information label contains version length items labels items label size A 00 00 74 7 2 8 15 and the item description label contains name type offset length un...

Страница 252: ...NGINEER CUPERTINO G SAND2 TECH WRITER CUPERTINO H THOREAU ENGINEER SAN DIEGO M FULLER2 ENGINEER CUPERTINO H THOREAU ENGINEER SAN DIEGO H THOREAU ENGINEER CUPERTINO H THOREAU ENGINEER SAN DIEGO G SAND2 TECH WRITER CUPERTINO G SAND TECH WRITER CUPERTINO M FULLER2 ENGINEER CUPERTINO G SAND TECH WRTIER CUPERTINO H THOREAU2ENGINEER CUPERTINO G SAND TECH WRITER CUPERTINO G SAND2 TECH WRITER CUPERTINO W ...

Страница 253: ... cause QUERY to terminate The procedure must be stored in one of the segmented libraries These libraries are searched in the following order group account system To call your de ned procedure replace the print element with the name of the procedure and replace the print position with a slash Seventeen parameters are automatically passed to the procedure by QUERY You may provide a single integer pa...

Страница 254: ...ers can be set by you Parameters CALLAGAIN is a ag telling QUERY to call this procedure again QUERY will stop calling the procedure only when this parameter is returned FALSE This ag is for the particular report statement being processed For example if D1 PROC CALLAGAIN T then the procedure will be called again from this detail statement until CALLAGAIN is set to false The default value is FALSE P...

Страница 255: ... procedure from QUERY DSET LIST contains the data set numbers of those data sets accessed by the FIND MULTIFIND or SUBSET command DATA BASE LIST contains the position of the data base name in the parameter BASE IDS for the corresponding entry in the parameter DSET LIST For example A zero 0 in DATA BASE LIST 2 means that the data set in DSET LIST 2 belongs to the rst data base named in BASE IDS LIN...

Страница 256: ...E DATA SET NAME is set with the correct data set name if data item values are needed from a data set s other than the default data set s see above parameter DBBUF or data item values are needed of data items other than those mentioned in the report The name should be upper case and left justi ed and the rest of the array should be lled with blanks The parameter DATA BASE NAME must also be set If t...

Страница 257: ...ERS SHIP DATE I2 IE 84140 IS 1984 140TH DAY IN YEAR DEPT U4 CARRIER U4 SETS NAME ACCT MAST A ENTRY ACCT NUM 2 CAPACITY 11 NAME ORDER D D ENTRY ACCT NUM ACCT MAST ORDER DATE DEPT CAPACITY 11 NAME SHIP D D ENTRY ACCT NUM ACCT MAST CARRIER SHIP DATE CAPACITY 11 END The retrieval and report are de ned as follows JOIN ORDER D ACCT NUM TO SHIP D ACCT NUM MU ALL USING SERIAL READ 14 COMPOUND ENTRIES RETR...

Страница 258: ...5 433 005 FRI DEC 14 1984 FRI DEC 28 1984 UPS 055 433 005 FRI DEC 14 1984 FRI DEC 28 1984 UPS 055 433 005 WED DEC 26 1984 FRI DEC 28 1984 UPS 055 433 005 WED DEC 26 1984 FRI DEC 28 1984 UPS SPL MPROC Procedure HAVING USLINIT AND SUBPROGRAM WILL GENERATE A WARNING YOU WILL NOT WANT TO INITIALIZE THE USL FILE IF YOU ARE COMPILING DIFFERENT SUBPROGRAMS INTO IT CONTROL MAP USLINIT SUBPROGRAM CONTROL S...

Страница 259: ...RD INTEGER AND NEEDS TO BE RE FORMATTED BEFORE PASSING TO FMTCALENDAR IF CALL NUM IS ONE THEN WE CAN ASSUME THE ENTRY IS FROM THE ORDER D DATA SET SINCE IT IS THE FIRST DATA SET MENTIONED IN THE JOIN COMMAND IF CALL NUM IS NOT ONE THEN WE CAN ASSUME THAT THE PROCEDURE HAS BEEN CALLED AGAIN AND WE NOW HAVE THE ENTRY FROM THE SHIP D DATA SET IF CALL NUM 1 THEN FIRST DATE D DATE DBBUF 3 ELSE SECOND D...

Страница 260: ...BOL USER DEFINED PROCEDURE USED WITH A REPORT STATEMENT THIS MUST BE COMPILED WITH THE COBOLII COMPILER THIS PROCEDURE TAKES A JULIAN DATE AND CONVERTS IT TO DAY MONTH YEAR FORMAT BY CALLING THE MPE INTRINSIC FMTCALENDAR ENVIRONMENT DIVISION DATA DIVISION WORKING STORAGE SECTION 01 FMTDATE REC 05 FMTDATE OCCURS 17 PIC X 01 I DAY PIC S9 4 COMP 01 YEAR PIC S9 4 COMP 01 HOLD PIC S9 9 COMP 01 D JDATE ...

Страница 261: ...01 DATA SET NAME PIC X 16 01 CALL NUM PIC S9 4 COMP 01 LINES LEFT PIC S9 4 COMP 01 PAGENO PIC S9 4 COMP 01 NUM DSETS PIC S9 4 COMP 01 NUM DBASES PIC S9 4 COMP MPROC PROCEDURE DIVISION PROCEDURE DIVISION USING CALLAGAIN PAGE EJECT BASE IDS DBBUF DSET LIST DATA BASE LIST LINEBUF REGARR USERSTOR USERPARAM DATA BASE NAME DATA SET NAME CALL NUM LINES LEFT PAGENO NUM DSETS NUM DBASES BEGIN MPROC THERE A...

Страница 262: ...ETERS IN ORDER TO GET THE ENTRY FROM THE SHIP D DATA SET TO FORMAT THE SHIPPING DATE IF CALL NUM 1 THEN MOVE FMTDATE REC TO BA LINEBUF1 MOVE ACCTS TO DATA BASE NAME MOVE SHIP D TO DATA SET NAME MOVE 1 TO CALLAGAIN ELSE MOVE FMTDATE REC TO BA LINEBUF2 MOVE 0 TO CALLAGAIN GOBACK COBOL Notes The call to FMTCALENDAR will generate a Questionable error because the second word of the I JDATE array is bei...

Страница 263: ...ORD BDS_NAME PACKED ARRAY 1 16 OF CHAR END 3 PROCEDURE MPROC VAR CALLAGAIN PAGE_EJECT SMALLINT VAR BASE_IDS BASEARRAY VAR DBBUF DBBUF_REC VAR DSET_LIST DATA_BASE_LIST LISTARRAY VAR LINEBUF LINEARRAY VAR REGARR REGARRAY VAR USERSTOR STORARRAY VAR USERPARAM SMALLINT VAR DATA_BASE_NAME DBARRAY VAR DATA_SET_NAME DSARRAY VAR CALL_NUM LINES_LEFT PAGENO SMALLINT VAR NUM_DSETS NUM_DBASES SMALLINT TYPE DAY...

Страница 264: ...HIP D DATA SET BEGIN IF CALL_NUM 1 THEN FIRST DATE BEGIN HOLD_BUF SINGLE_INT 1 DBBUF DBBUF_INT 4 HOLD_BUF SINGLE_INT 2 DBBUF DBBUF_INT 5 END ELSE SECOND DATE BEGIN HOLD_BUF SINGLE_INT 1 DBBUF DBBUF_INT 6 HOLD_BUF SINGLE_INT 2 DBBUF DBBUF_INT 7 END YEAR D_YEAR HOLD_BUF DOUBLE_INT DIV 1000 ISOLATE YEAR HOLD YEAR D_YEAR 1000 DAY D_DAY HOLD_BUF DOUBLE_INT HOLD JDATE DAY_YR DAY DAY DAY 2 DAY IN BITS 0 ...

Страница 265: ... referenced 2 For proper storage one character per byte character data should be in a PACKED ARRAY OF CHAR PACs However PACs have byte addresses and the data passed between QUERY and the user de ned procedure must have word addresses When a PAC is declared as a eld in a RECORD it has a word address 3 QUERY passes all parameters as word addresses The parameters must be declared as VAR so that indir...

Страница 266: ... MPROC DECLARATION SUBROUTINE MPROC CALLAGAIN PAGEEJECT BASEIDS DBBUF DSETLIST DBLIST LINEBUF REGARR USERSTOR USERPARAM DBNAME DSNAME CALLNUM LINESLEFT PAGENO NUMDSETS NUMDBASES LOGICAL CALLAGAIN PAGEEJECT INTEGER BASEIDS 130 DBBUF 2051 DSETLIST 53 DBLIST 53 INTEGER LINEBUF 69 REGARR 150 USERSTOR 64 INTEGER USERPARAM INTEGER DBNAME 13 DSNAME 8 INTEGER CALLNUM LINESLEFT PAGENO NUMDSETS NUMDBASES IN...

Страница 267: ...E NOW HAVE THE ENTRY FROM THE SHIP D DATA SET IF CALLNUM GT 1 GOTO 100 HOLD 1 DBBUF 4 HOLD 2 DBBUF 5 GOTO 200 100 HOLD 1 DBBUF 6 HOLD 2 DBBUF 7 200 DYEAR DHOLD 1000 HOLDYR DYEAR 1000 DDAY DHOLD HOLDYR JDATE 0 7 BOOL YEAR 2 JDATE 7 9 BOOL DAY 2 DO 225 N 1 18 225 BFMTDATE N CALL FMTCALENDAR JDATE BFMTDATE PUT THE FORMATTED DATE INTO THE OUTPUT BUFFER USED BY QUERY FOR THE REPORT OUTPUT LINE AGAIN CA...

Страница 268: ...Y at an input prompt The procedure will terminate after that sequence of parameter prompts is nished and the report command will terminate SPL QPROC Procedure PAGE QPROC Program Description CONTROL MAP USLINIT SUBPROGRAM CONTROL SEGMENT QPROC Q P R O C SPL Example of QUERY user callable procedure begin INTRINSIC PRINT ASCII DASCII DEBUG READ BINARY PROCEDURE QPROC CALLAGAIN PAGE EJECT BASE IDS DBB...

Страница 269: ...F B BUF INTEGER BUF INDX ARRAY BUF1 0 50 BYTE ARRAY BUF1 B BUF1 LONG ARRAY TEMP L 0 1 INTEGER ARRAY TEMP I TEMP L PAGE QPROC Outer block START OF QPROC PRINT BUF 0 60 PRINT BUF 0 60 move BUF B 0 PROCEDURE QPROC PRINT BUF 49 40 CALL AGAIN move BUF CALL AGAIN CHANGE to True or False PRINT BUF 0 40 PRINT BUF 42 40 if CALLAGAIN TRUE then move BUF TRUE if CALLAGAIN FALSE then move BUF FALSE PRINT BUF 9...

Страница 270: ...ASE IDS 13 10 BUF B 35 move BUF B NUM CHAR 35 BASE IDS B 28 24 end end PRINT BUF 79 40 PAGE DATA BASE RECORD BUFFER move BUF DB BUFFER PRINT BUF 0 40 PRINT BUF 15 40 move BUF B 0 79 For I 0 until 10 do ASCII DBBUF I 8 BUF B I 7 PRINT BUF 79 40 move BUF B 0 79 For I 0 step 7 until 70 do begin BUF B I 1 DBBUF B I 7 2 if BUF B I 1 40 or BUF B I 1 176 then BUF B I 1 40 BUF B I 4 DBBUF B I 7 2 1 if BUF...

Страница 271: ...ve TEMP I REGARR J 4 NUM CHAR DASCII FIXR REAL TEMP L 10 BUF B I J J 5 end PRINT BUF 79 40 I READ BUF 79 END PTR 0 START PTR 0 DEC PTR 0 BUF INDX 0 REG INDEX 0 if J 0 then go to SKIP REGISTER LOAD SEE BELOW REGISTER LOAD For J 0 until I do begin if BUF B J then END PTR J if BUF B J or J I then begin if DEC PTR START PTR then DEC PTR END PTR NO DECIMAL K BINARY BUF1 B BUF INDX if then K 0 TEMP L LO...

Страница 272: ... CHAR ASCII USERPARAM 10 BUF B PRINT BUF 0 40 PRINT BUF NUM CHAR 40 GET USERPARAM I READ BUF 7 if I 0 then begin USERPARAM BINARY BUF B I if then begin move BUF DBINARY COULD NOT CONVERT PRINT BUF 31 40 go to GET USERPARAM end end DATA BASE NAME move BUF DATA BASE NAME PRINT BUF 0 40 PRINT BUF 20 40 PRINT DATA BASE NAME 26 40 I READ DATA BASE NAME 26 DATA SET NAME move BUF DATA SET NAME PRINT BUF ...

Страница 273: ...ASCII NUM DSETS 10 BUF B PRINT BUF NUM CHAR 40 NUMBER OF DATA BASES move BUF NUMBER OF DATA BASES PRINT BUF 0 40 PRINT BUF 26 60 DOUBLE SPACE AFTER LAST LINE NUM CHAR ASCII NUM DBASES 10 BUF B PRINT BUF NUM CHAR 40 end end COBOL QPROC Procedure CONTROL USLINIT SUBPROGRAM DYNAMIC IDENTIFICATION DIVISION PROGRAM ID QPROC AUTHOR HP Q P R O C COBOL Example of QUERY user callable procedure QPROC requir...

Страница 274: ... 01 LINEBUF 05 LINEBUF 70 PIC X 70 05 LINEBUF OTHER PIC X 66 01 REGARR 05 REG OCCURS 30 TIMES PIC S9 18 COMP 3 01 USERSTOR 05 USERSTOR 70 PIC X 70 05 USERSTOR OTHER PIC X 58 01 USERPARAM PIC S9 4 COMP 01 DATA BASE NAME PIC X 26 01 DATA SET NAME PIC X 16 01 CALL NUM PIC S9 4 COMP 01 LINES LEFT PIC S9 4 COMP 01 PAGENO PIC S9 4 COMP 01 NUM DSETS PIC S9 4 COMP 01 NUM DBASES PIC S9 4 COMP PAGE QPROC Pr...

Страница 275: ...ASE ID1 BASE NAME1 ELSE DISPLAY BASE ID1 BASE NAME1 BASE ID2 BASE NAME2 DATA BASE RECORD BUFFER DISPLAY SPACE DISPLAY DB BUFFER Decimal and Character DISPLAY DBBUFI 1 DBBUFI 2 DBBUFI 3 DBBUFI 4 DBBUFI 5 DBBUFI 6 DBBUFI 7 DBBUFI 8 DBBUFI 9 DBBUFI 10 DISPLAY DBBUF 70 LIST OF DATA SETS DISPLAY SPACE DISPLAY DATA SET LIST DISPLAY DSET 1 DSET 2 DSET 3 DSET 4 DSET 5 DSET 6 DSET 7 DSET 8 DSET 9 LIST OF D...

Страница 276: ... AND REG NBR 31 THEN DISPLAY ENTER VALUE FOR REGISTER ADD 1 TO REG NBR ACCEPT REG REG NBR FREE IF BUFX 1 Y OR BUFX 1 y THEN GO TO DISPLAY REGISTERS USER STORE ARRAY DISPLAY SPACE DISPLAY USER STORE DISPLAY USERSTOR 70 ACCEPT USERSTOR USER PARAMETER DISPLAY SPACE DISPLAY USER PARAMETER DISPLAY USERPARAM ACCEPT USERPARAM FREE DATA BASE NAME DISPLAY SPACE DISPLAY DATA BASE NAME DISPLAY DATA BASE NAME...

Страница 277: ...AY LINES LEFT DISPLAY LINES LEFT PAGE NUMBER DISPLAY SPACE DISPLAY PAGE NUMBER DISPLAY PAGENO NUMBER OF DATA SETS DISPLAY SPACE DISPLAY NUM DSETS DISPLAY NUM DSETS NUMBER OF DATA BASES DISPLAY SPACE DISPLAY NUMBER OF DATA BASES DISPLAY NUM DBASES GOBACK USER DEFINED PROCEDURES F 25 ...

Страница 278: ......

Страница 279: ...G ASCII CHARACTER SET This appendix is not available in this edition ASCII CHARACTER SET G 1 ...

Страница 280: ......

Отзывы: