Start Query Management Proc (STRQMPRC)

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

The Start Query Management Procedure (STRQMPRC) command allows you to run a query management procedure that was saved as a member in a source file.

Top

Parameters

Keyword Description Choices Notes
SRCMBR Source member Name Required, Positional 1
SRCFILE Source file Qualified object name Optional, Positional 2
Qualifier 1: Source file Name, QQMPRCSRC
Qualifier 2: Library Name, *LIBL, *CURLIB
RDB Relational database Simple name, *NONE, *CURRENT Optional
RDBCNNMTH Connection Method *DUW, *RUW Optional
USER User Name, *CURRENT Optional
PASSWORD Password Character value, *NONE Optional
NAMING Naming convention *SYS, *SQL, *SAA Optional
ALWQRYDFN Allow information from QRYDFN *NO, *YES, *ONLY Optional
CMDSRCFILE Command source file Single values: *NONE
Other values: Qualified object name
Optional
Qualifier 1: Command source file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
CMDSRCMBR Source member Name, *FIRST Optional
ALWDSPLAY Display screens *YES, *NO Optional
Top

Source member (SRCMBR)

Specifies the source file member that contains the query management procedure to be run.

This is a required parameter.

name
Specify the name of the member.
Top

Source file (SRCFILE)

Specifies the source file that contains the query management procedure to be run.

This is a required parameter.

Qualifier 1: Source file

QQMPRCSRC
IBM-supplied source file QQMPRCSRC is used.
name
Specify the name of the source file.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
name
Specify the name of the library to be searched.
Top

Relational database (RDB)

Specifies the relation database that is accessed during the processing of this command.

*NONE
The local database is accessed. If the user is connected to a remote database, the connection is reset to local and remains local until completion of this command.
*CURRENT
The relational database to which the user is currently connected is accessed.
name
Specify the name of the relational database that is accessed. The database must have an entry in the relation database directory.
Top

Connection Method (RDBCNNMTH)

Specifies the connection method to use.

*DUW
Connections to several relational databases are allowed. Consecutive CONNECT statements to additional relational databases do not result in disconnection of previous connections.
*RUW
Only one connection to a relational database is allowed. Consecutive CONNECT statements result in the previous connections being disconnected before a new connection is established.
Top

User (USER)

Specifies the user name sent to the remote system when starting the conversation.

*CURRENT
The user name associated with the current job is used.
name
Specify the user name being used for the application requester job.
Top

Password (PASSWORD)

Specifies the password to be used on the remote system.

*NONE
No password is sent. The user name specified on the USER parameter is not valid if this value is specified.
character-value
Specify the password of the user name specified on the USER parameter.
Top

Naming convention (NAMING)

Specifies the naming convention used for naming objects.

*SYS
The system naming convention is used (name/object-name).
*SQL
The SQL naming convention is used (database-name.object-name). If NAMING(*SQL) is specified, CMDSRCFILE(*LIBL) cannot be specified or allowed as a default value for locating any of the objects specified on other parameters on this command.
*SAA
The SQL naming convention is used (database-name.object-name). If NAMING(*SAA) is specified, CMDSRCFILE(*LIBL) cannot be specified or allowed as a default value for locating any of the objects specified on other parameters on this command.
Top

Allow information from QRYDFN (ALWQRYDFN)

Specifies whether query or form information is taken from a query definition (QRYDFN) object when no query management query (QMQRY) or query management form (QMFORM) object can be found using the specified object name. Any information that has to be derived in this way is discarded when the common programming interface (CPI) command in the procedure is completed. No query management objects are created.

*NO
The information is not taken from a QRYDFN object.
*YES
The information is taken from a QRYDFN object when the specified QMQRY or QMFORM object is not found.
*ONLY
Information can be derived only from a QRYDFN object. Query management objects are ignored.
Top

Command source file (CMDSRCFILE)

Specifies the command source file that query management uses to run a command procedure. A command procedure can only contain query management set commands which can set application variables as well as query management variables that start with the 'DSQ' value.

The supported DSQ variables are:

Single values

*NONE
A command source file is not used. The CMDSRCMBR parameter is ignored.

Qualifier 1: Command source file

name
Specify the name of the command source file.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
name
Specify the name of the library to be searched.
Top

Source member (CMDSRCMBR)

Specifies the command source member that query management uses to run a command procedure. A command procedure can only contain query management set commands which set variables that start with the 'DSQ' value.

*FIRST
The first member is used.
name
Specify the name of the command source member.
Top

Display screens (ALWDSPLAY)

Specifies the display mode used. The query management session is set to interactive mode if ALWDSPLAY(*YES) is specified. If ALWDSPLAY(*NO) is specified, then the session is set to batch mode. The mode is automatically set to batch when running this command in a batch environment.

*YES
Displays are shown when used in an interactive session. This mode allows you to interact with the query management commands in the procedure.
*NO
No displays are shown.
Top

Examples

Example 1: Running a Query Management Procedure

STRQMPRC   SRCMBR(MYPROC)  SRCFILE(RPTLIB/PROCFILE)

This command starts the query management procedure stored as the member named MYPROC in the source file named PROCFILE in the RPTLIB library.

Example 2: Taking Information From QRYDFN Objects

STRQMPRC   SRCMBR(MYPROC)  SRCFILE(PROCFILE)
           ALWQRYDFN(*YES)  ALWDSPLAY(*NO)

This command starts the query management procedure stored as the member named MYPROC in the first file named PROCFILE in the library list for the job. Query and form information is allowed to be taken, as needed, from QRYDFN objects when the procedure statements are processed. No reports are shown but they can be printed if the user specifies a print request. Objects are replaced without confirmation if confirmation is not requested by the user. The procedure ends with some errors if processing locates a global variable that is not set or if confirmation was requested before replacing objects that already exist.

Top

Error messages

*ESCAPE Messages

QWM2701
&1 command failed.
QWM2703
&1 command ended.
QWM2707
*LIBL not allowed when SQL naming applied.
QWM2709
User or password not valid with relational database value.
QWM2710
Password value *NONE only valid with user value *CURRENT.
QWM2712
Character in user name not valid.
Top