In the previous installment of this column I presented the Set Query Profile Options (SETQRYPRFO) command, which allows you to tailor various runtime options and batch job attributes for the Query/400 Work with Query (WRKQRY) command and relies on the special query profile options data area QQUPRFOPTS. This time around I've created the Work with Query Profile Options (WRKQRYPRFO) command that will help you monitor and manage your query profile options data areas.
The purpose of creating and configuring the QQUPRFOPTS data area in different libraries is to support different settings for different user profiles. In order to do so you need to ensure that the library containing the QQUPRFOPTS data area designated for the respective user profile is placed ahead of other libraries containing a QQUPRFOPTS data area in the user's library list or to exclude these other libraries from the library list altogether. Whenever you evoke the WRKQRY command, Query/400 uses the job's library list to locate the QQUPRFOPTS data area and attempts to read the first one found.
Note, that if the current user profile does not have sufficient authority to the resolved QQUPRFOPTS data area, the system uses default values for the attributes defined in the data area. So make sure the users have authority to the first ocurrance of the data area in their library list.
At this point the WRKQRYPRFO command comes in handy in terms of getting an overview of existing QQUPRFOPTS data areas and what libraries they reside in. The command also provides access to a number of commands related to the task of creating and maintaining these data areas. The command's prompt panel is quite simple, as shown here:
Work with Query Profile Opts (WRKQRYPRFO)
Type choices, press Enter.
Library . . . . . . . . . . . . *ALL Name, generic*, *LIBL...
Output . . . . . . . . . . . . . * *, *PRINT
The command and its parameters are of course documented in detail in the online help text panel group. Here's how the resulting Work-with panel looks on my system:
Work with Query Profile Options WYNDHAMW
29-11-09 13:18:42
Library . . . . . *ALL Position to . . .
Type options, press Enter.
1=Set query profile options 3=Copy 4=Delete 5=Display
9=Edit authority 13=Change description
Options
Opt Library Owner Text
QRYSYSOPR QSYSOPR Query/400 User Profile Options
QRYUSER QSECOFR Query/400 User Profile Options
QRYPGMR QPGMR Query/400 User Profile Options
QUSRSYS QDFTOWN Query/400 User Profile Options
Bottom
Parameters or command
===>
F3=Exit F5=Refresh F6=Set query profile options
F11=Display query profile options F12=Cancel F24=More keys
Again, the panel is accompanyed by an on-line cursor sensitive help text panel group, explaining all the details of the panel and the associated commands. As for more details on the SETQRYPRFO command please refer to the article mentioned above. The following source code is involved in creating the WRKQRYPRFO command:
CBX994 RPGLE Work with Query Profile Options - CPP CBX994E RPGLE Work with Query Profile Options - UIM Exit Program CBX994H PNLGRP Work with Query Profile Options - Help CBX994P PNLGRP Work with Query Profile Options - Panel Group CBX994V RPGLE Work with Query Profile Options - VCP CBX994X CMD Work with Query Profile Options CBX994M CLP Work with Query Profile Options - Build command
To have the WRKQRYPRFO command created for you, copy the source members to their respective source files and follow the instructions in the CBX994M CL program.
You can download the code here...