Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Query Document Library (QRYDOCLIB) command allows you to search for documents within the document library. A document list is created containing the results of the search. You can also copy information about the documents that satisfy the search request into a database file for processing.
When the QRYDOCLIB command is run, a document list object is created. The document list object is created regardless of whether an output file is produced unless the user specifies *NONE for the DOCL parameter. This document list object is used by the OfficeVision/400 product as well as the SAVDLO command.
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
QRYDFN | Query definition | Single values: *NONE Other values: Element list |
Optional |
Element 1: Start query | *IF | ||
Element 2: Search criteria | Values (up to 49 repetitions): Element list | ||
Element 1: Profile | *ACTDATE, *ALWRPL, *ASP, *AUTHOR, *CHGDATE, *CMPDATE, *CPYLST, *CRTDATE, *DOCCLS, *DOCD, *DOCDATE, *DOCTYPE, *EXPDATE, *FILDATE, *IDXDATE, *KWD, *OWNER, *PROJECT, *REF, *REVDATE, *STATUS, *SUBJECT, *USEDATE | ||
Element 2: Relational operator | *EQ, *GT, *LT, *NE, *GE, *NL, *LE, *NG, *CT, *BG | ||
Element 3: Compare value | Character value, *YES, *NO | ||
Element 4: Logical operator | *AND, *OR | ||
FLR | In folder | Single values: *ALL Other values (up to 100 repetitions): Character value, *NONE |
Optional |
SCHSUBFLR | Search subfolder | *NO, *YES | Optional |
QRYTXT | Query text | Single values: *NONE Other values: Element list |
Optional |
Element 1: Start query | *IF | ||
Element 2: Search criteria | Values (up to 30 repetitions): Element list | ||
Element 1: Phrase | Character value | ||
Element 2: Type of matching | *ALL, *EXACT | ||
Element 3: Allow synonyms | *NO, *YES | ||
Element 4: Logical operator | *OR, *AND, *ANDNOT | ||
TXTLANGID | Language ID | Character value, *JOB | Optional |
DOCL | Document list | Character value, *DFT, *NONE | Optional |
TEXT | Text | Character value, *BLANK | Optional |
OUTFILE | File to receive output | Single values: *NONE Other values: Qualified object name |
Optional |
Qualifier 1: File to receive output | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
OUTMBR | Output member options | Element list | Optional |
Element 1: Member to receive output | Name, *FIRST | ||
Element 2: Replace or add records | *REPLACE, *ADD | ||
OUTDTATYP | Type of data for output | Single values: *DFT, *ALL Other values (up to 21 repetitions): *ACTDATE, *AUTHOR, *CHGDATE, *CMPDATE, *CPYLST, *CRTDATE, *DOCCLS, *DOCD, *DOCDATE, *EXPDATE, *FILCAB, *FILDATE, *IDP, *IDXDATE, *KWD, *PROJECT, *REF, *REVDATE, *STATUS, *SUBJECT, *USEDATE |
Optional |
USRID | User identifier | Single values: *CURRENT Other values: Element list |
Optional, Positional 1 |
Element 1: User ID | Character value | ||
Element 2: Address | Character value | ||
TIMLMT | Time limit | 1-9999, *NOMAX | Optional |
SELLMT | Selection limit | 1-32767, *NOMAX | Optional |
ORDER | Order by | Single values: *NONE Other values (up to 5 repetitions): Element list |
Optional |
Element 1: Profile | *ACTDATE, *ASP, *AUTHOR, *CHGDATE, *CMPDATE, *CPYLST, *CRTDATE, *DOCCLS, *DOCD, *DOCDATE, *DOCTYPE, *EXPDATE, *FILDATE, *IDXDATE, *KWD, *OWNER, *PROJECT, *REF, *REVDATE, *STATUS, *SUBJECT, *USEDATE | ||
Element 2: Selection order | *ASCEND, *DESCEND | ||
CMDCHRID | Command character identifier | Single values: *SYSVAL, *DEVD Other values: Element list |
Optional |
Element 1: Graphic character set | Integer | ||
Element 2: Code page | Integer |
Top |
Specifies what query definition selection values are used to select the documents. The values you specify on this parameter are used to search the document library. If values other than *NONE are specified on both the Query text (QRYTXT) parameter and this parameter, only documents that match both sets of values are selected. If you specify *NONE on both parameters, all documents to which you are authorized are selected.
Single values
Element 1: Start query
Element 2: Search criteria
To specify the conditions under which documents are selected, a set of values is specified for each condition. Each set must contain exactly four values:
Values 1 and 3 are compared for the relationship specified by value 2. Each QRYDFN relational set must be enclosed in parentheses. A maximum of 49 sets of values can be specified.
Element 1: Profile
Specifies the name of the document profile parameter to be compared.
Element 2: Relational operator
The relational operator indicates the relationship that must exist between the profile parameter contents in the document and the value specified as the compare value parameter of the query definition for the relationship to be true.
The *CT operator is used to perform a context search. It asks the system to determine whether the character string specified by the compare value is contained anywhere in the profile parameter.
The *BG operator is used to perform a search that compares the compare value with the beginning of the profile parameter. The profile parameter is truncated or extended as necessary to match the length of the specified value. It asks the system to determine whether the character string specified by the value is contained at the beginning of the profile parameter.
Some operators are not allowed for some profile parameters. In this case, a diagnostic message followed by an escape message is sent.
The following cases are not valid:
Element 3: Compare value
Specifies the compare value to be used in the search.
The *ALWRPL field has two special values: *YES and *NO. When these are specified with the *ALWRPL field, they are changed to internal values for the indicator. When *YES or *NO are specified for the text field, they are used like they are.
The *OWNER field is an 8-character user ID followed by its address. Trailing blanks cannot be omitted from the user ID. For example, if the user ID is JMDOE and the address is SYSTEM1, the query request would be:
(*IF ((*OWNER *EQ 'JMDOE SYSTEM1'))).
If the user ID is JIMSMITH, the query request would be:
(*IF ((*OWNER *EQ 'JIMSMITHSYSTEM1'))).
Dates must be entered in the system date format.
Note: If one of the date profile parameters is specified and the compare value is ' '(blank), then the compare value is equated to 01/01/01 or 01/001 for Julian date. '/' is changed depending on the system separator value QDATSEP.
The allowable length for the search fields is limited by the Document Interchange Architecture (DIA) search database. When the length of the value is greater than the maximum, the value is truncated to the allowed length. The maximum lengths are:
For all operators except *CT and *BG, if a value is specified that is shorter than the profile parameter value, then the specified value is extended with blanks to match the length of the profile parameter.
The case (upper, lower, or mixed) that is used to enter the original parameter value or the case of the comparison value do not matter. The system changes both the entered comparison value and the original parameter value to upper case before making a comparison.
Element 4: Logical operator
The logical operators are used to group conditions. The first AND operator encountered signifies that a condition group starts with the condition immediately preceding the AND operator. Subsequent conditions with the AND operator are added to the condition group. The first condition encountered containing the OR operator or the last condition in the query definition ends the condition group.
Top |
Specifies the folders to search for the documents that match the search values specified on the Query definition (QRYDFN) parameter and the Query text (QRYTXT) parameter.
Top |
Specifies whether subfolders of the folder specified on the In folder (FLR) parameter are searched.
Top |
Specifies the text search values used to select documents. The values you specify on this parameter are used to search the text index. If values other than *NONE are specified on both the Query definition (QRYDFN) parameter and this parameter, only documents that match both sets of values are selected. If you specify *NONE on both parameters, all documents to which you are authorized are selected.
Single values
Element 1: Start query
Element 2: Search criteria
To specify the conditions under which documents are selected, a set of values is specified for each condition. Each set contains four values:
A maximum of 30 sets of values can be specified. Each set must be enclosed in parentheses.
Element 1: Phrase
Specifies a phrase which the system compares to entries in the text search index.
annual * report
The search results will include documents containing such phrases as annual budget report, annual progress report, and annual sales report. The search results will also include documents containing the phrase 'annual report' without a word in between.
When using a word mask, you must specify a word before and after the asterisk. A word mask at the beginning or end of a phrase is ignored.
word process*
The search results will include documents containing such phrases as word processing, word processor, and word processed.
j?hns?n
The search results will include documents containing such phrases as johnson, johnsen, and jahnson.
Element 2: Type of matching
Specifies a type of matching value to be used in the search.
Element 3: Allow synonyms
Specifies whether synonyms are to be used in the search.
Note: Using synonyms may affect the performance of the request by causing more words to be searched for, and possibly by causing more documents to be selected.
Element 4: Logical operator
Specifies a logical operator to be used in the search.
Top |
Specifies the language identifier for the phrases in the query text. This parameter is required if the Query text (QRYTXT) parameter is specified; it is not allowed if the QRYTXT parameter is not specified or has a value of *NONE.
Top |
Specifies the name of the document list. The document list contains a pointer to each document in the document library that is qualified for search. This list is a copy of the library at the time the search was run. As documents are deleted from the library or added to the library, the document list is not updated. The document library list name is specified with the name of the user requesting the search.
Top |
Specifies the text that briefly describes the object.
Top |
Specifies the database file to which the output of the command is directed. If the file does not exist, this command creates a database file in the specified library. If the file is created, the public authority for the file is the same as the create authority specified for the library in which the file is created. Use the Display Library Description (DSPLIBD) command to show the library's create authority.
Qualifier 1: File to receive output
Qualifier 2: Library
Note: If a new file is created, the system uses QAOSIQDL in QSYS with a format name of OSQDL as a model.
Top |
Specifies the name of the database file member that receives the output of the command.
Element 1: Member to receive output
Element 2: Replace or add records
Top |
Specifies that certain information about the selected documents is written to the output file if a value is specified on the File to receive output (OUTFILE) parameter.
Top |
Specifies which user ID and user ID address should be associated with the request.
Single values
Element 1: User ID
Element 2: Address
Top |
Specifies the amount of time allowed for the requested search to run.
Top |
Specifies the allowed number of documents to select in the search.
Top |
Specifies that the selected documents are to be ordered (ascending or descending) when placed in the created document list or output file. The order is defined for one or more document profile parameters specified, up to a maximum of 5.
Note: If a value other than *NONE is specified on the Query text (QRYTXT) parameter, ordering is not allowed.
When a user specifies an order to the search request, the performance of the request may be affected. The request performs best if no order is specified.
Single values
Element 1: Profile
Element 2: Selection order
Top |
Specifies the character identifier (graphic character set and code page) for the data being entered as command parameter values. The character identifier is related to the display device used to enter the command.
The CMDCHRID parameter applies to the following parameters and means that the data is translated to the code page and character set common to all documents in the search database. That character set and code page is '697 500', except for the User identifier (USRID) parameter, which is '930 500'.
The following parameters are translated:
Single values
Element 1: Graphic character set
Element 2: Code page
Top |
QRYDOCLIB USRID(*CURRENT) OUTFILE(*NONE) DOCL(MYLIST) QRYDFN(*IF ((*DOCD *EQ DOCDESC *AND) (*DOCCLS *BG CLASS *OR) (*FILDATE *LE '06/13/88')))
This command searches for documents that meet the following search conditions: document description equals DOCDESC and document class starts with Class; or the file date is on or before 06/13/88. The results of the search will be stored in the document list MYLIST.
Top |
*ESCAPE Messages
Top |