Work with File Fields iQuery (WRKIQRY)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Work File using SQL iQuery (WRKIQRY) command presents you with a list of field (column) names for the given database file (table). From that list, you may query the file using all the fields or selecting the fields to appear in the output.

Most user who are not advanced SQL users, (as well as many advanced SQL users) prefer the ease-of-use that WRKIQRY provides to run SQL over the database.

Work File using SQL iQuery allows users to view the SQL statement before it is run by pressing F14 (shift+F2), to prompt the resulting RUNIQRY command (by pressing F4), or to run a Query immediately by pressing F10. Query's run using WRKIQRY include the LOG(*YES) parameter, resulting in the SQL statement being written to the joblog as a message.

Restrictions:

Top

Parameters

Keyword Description Choices Notes
FILE Database file Qualified object name Required, Positional 1
Qualifier 1: Database file Name
Qualifier 2: Library Name, *CURLIB, *LIBL, *USER, *USRPRF
RDB Remote Database System Character value, *LOCAL Optional, Positional 2
USER Remote Database User ID Character value, *NONE, *USER, *USRPRF, *CURRENT Optional, Positional 3
PWD Remote Database Password Character value, *NONE Optional, Positional 4
APPTITLE Title Text Line 1 Character value, *DFT, *NONE Optional, Positional 5
USRTITLE Title Text Line 2 Character value, *DFT, *NONE Optional, Positional 6
Top

Database file to query (FILE)

Specifies the database file whose fields are displayed. If no library or *LIBL is specified, the library list is searched for the database file. The maximum length of a file name is 128 characters and is converted to a 10-character system object name automatically when a long name is specified.

This is a required parameter.

Qualifier 1: Database file to query

name
Specify the name of an existing database file whose field definitions are loaded into WRKIQRY.

Qualifier 2: Library

*LIBL
The library list is searched for the database file. This is the default.
*CURLIB
The current library is searched for the file. If the job has no current library, then QGPL is searched for the file.
*USRPRF or *USER
The user profile is used as the library name. That library is searched for the database file.
name
Specify the name of any library that contains the database file.
Top
Top
Top
Top

Output Title Line 1 (USRTITLE)

Specifies an optional User-specified Title text for the WRKIQRY work with panel. This text is displayed on line 1 of the WRKIQRY panel. It is also passed to the SQL iQuery command.

*DFT
The default SQL iQuery title is used as the title text.
character-value
Specify any text string (up to 50 characters) that shall be displayed on line 1 of the WRKIQRY panel.
Top

Output Title Line 2 (USRTITLE)

Specifies an optional User-specified Title text for the WRKIQRY work with panel. This text is displayed on line 2 of the field list panel. It is also passed to the SQL iQuery command.

*DFT
The default SQL iQuery title is used as the title text.
character-value
Specify any text string (up to 50 characters) that shall be displayed on line 2 of the WRKIQRY panel.
Top

Examples for WRKIQRY

Example 1: Simple Command Example

WRKIQRY  FILE(CUSTMAST)

This command generates and displays a list of fields contained in the CUSTMAST file (located on the library list) from which the user may select fields to be included in a SQL iQuery command.

Top

Error messages

Unknown
Top