QMF (query management facility) is an optional add-on to DB/2 designed to help novice and casual users formulate database requests and format reports. It can also be used to test your DB/2 queries before coding them into your programs. QMF provides its own method of attaching to DB/2 databases and does not use TSO, IMS, or CICS to attach. Also because QMF is separate from DB/2, it provides its own menus on ISPF and is not a sub-option of DB2I.

With QMF you can build database queries where the constants that would otherwise be coded into the SQL are replaced by parameters. Parameters are coded into the statements by preceding the parameter name with an ampersand eg. &MYPARM. You can save these queries for later use.

You can execute a saved query multiple times specifying different values to be substituted for the parameters and thus produce a number of similar reports that differ either because different parameters were specified for the execution or because the content of the database has changed between executions.

You can have problems with your database when end users have access to formulate queries with QMF as every time you save data in QMF, DB/2 creates a table to hold the data. This can create contention issues with other QMF users who are also trying to save data. QMF rebinds your query or report every time that it is executed and the database definition gets locked in order to do this which can also lock other users out from being able to access the database. The number of users with access via QMF to any given database should therefore be limited. With as few as 20 active users performance will be dramatically reduced.

QMF itself stores your queries in a database called Q.OBJECT_DATA. Only saved queries are stored.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow