We have mentioned several QMF commands in the process of introducing you to QMF. Let us go back for a more detailed look at some of these commands and take a first look at some additional ones.


The SAVE command creates a permanent object from the contents of a temporary storage area. With the exception of the object PROFILE, it associates a name with the saved object. Suppose you want other QMF users to be able to use your QUERYs, PROCs, FORMS, or Data. If you include the SHARE parameter when you save, then other IDS will have access to the saved object. For example, to save a PROC that others will use you would code:


If you omit the SHARE parameter, only your ID will be able to access MYPROC in the future. I have also included the COMMENT parameter in this example. A comment must be enclosed in single quotation marks and may be up to 57 characters long, including the quotation marks. You cannot use COMMENT with PROFILE and neither PROFILE nor DATA use the SHARE parameter. COMMENT lets you document the objects you create so other users can understand their use.


We used DISPLAY and SHOW to navigate through QMF's panels and display the contents of temporary storage areas. DISPLAY has a second function. It can be used to retrieve permanent objects from the QMF database and replace the contents of the temporary storage area with them. The syntax is:


The name part of the command is the ob ject's name as it was specified in the AS objectname clause of the SAVE command. You may specify the type of object (QUERY, FORM, PROC, or TABLE) before the name but it is not required. When DATA is saved, it becomes a TABLE, so to display it you would issue a DISPLAY command such as:


Each object is displayed on its associated panel. A table is displayed on the Report Panel. DISPLAY TABLE can be used to display any table for which you have SELECT authority. It is analogous to issuing a

SELECT * FROM table name from the Query Panel.


RUN, like DISPLAY, can also be used with permanent objects from the database. The syntax is very similar:

RUN name

Again, the name may be preceded by object type, but it is not necessary. For RUN this will be either QUERY or PROC, the only types of objects that can be submitted for execution. Earlier, when we wanted to run a QUERY using the contents of FORM to format the output, we coded:


Since you have learned how to save the form permanently, we can specify not only a permanent query to run, but also a permanent FORM to format it with. For instance we could code:


Notice that we also used the optional CONFIRM parameter to override the CONFIRM value in our PROFILE for the duration of this command. This means that a confirmation panel will appear when we submit this command, giving us the option of continuing, or canceling, the command which would have modified rows in the database. We should mention the QMF Command Prompt Panels. They are quite useful for syntax help when submitting a command. Type the command followed by a question mark and an appropriate panel is displayed. For example, if you type:


A RUN command Prompt Panel is displayed on which you can specify the type of object (QUERY or PROO and, if it is a saved object, the object name. If it is a QUERY you are running, a second panel will then be displayed where you can optionally specify the FORM and CONFIRM parameters.


You have seen how it is possible to share QUERYs, FORMS, etc., with other users of the same QMF system by using the SHARE parameter. At times, you might also want to transport your objects to users on a different system, perhaps from test to production. The IMPORT and EXPORT commands make this possible by letting you pass information between the TSO or CMS environments and QMF. We will assume we are using a TSO environment for the purposes of our discussion. IMPORT and EXPORT also make it possible to modify objects outside of QMF and apply non-QMF processes to them. Both commands can be used with QMF's temporary storage areas or with QMF's permanent database objects. Let us see how this works with IMPORT first. IMPORT can be used to bring a QUERY into the QUERY temporary storage area. For example:


We are importing from a dataset external to DB2. The QUERYtemporary storage area now holds the contents USERID.QUERY.LIBRARY(QUERYl). The. sarjae format is used to IMPORT FORMS, PROCs, and DATA; the type of object must be specified. With the* query in temporary storage, you can now issue the SAVE command to create a permanent query in the new environment. You can also do this with the IMPORT command directly. We will modify the command to include the name that the object will have in the database. For example:


This statement brings member QUERY1 into temporary storage and, at the same time, stores it permanently as MYQUERY. If MYQUERY already exists, it will be replaced; otherwise it will be created. You may do the same with FORMS, PROCs, and TABLES.

To IMPORT data into temporary storage, use the object type DATA. To IMPORT data into the database, use TABLE. A restriction specific to IMPORT DATA or IMPORT TABLE is that the data must be in either QMF or IXF format. These, you will see, are the two options for data format on the EXPORT command. QMF is the default. There are a few other things to be aware of with the IMPORT command. One is that QMF expects each line in a QUERY or PROC to be 79 characters long and will truncate or pad with blanks if your dataset records are not this length. The limit for a QUERY or PROC is 409 lines, a maximum that is hard to exceed.

EXPORT is similar in syntax to IMPORT. From temporary storage you may EXPORT QUERY, FORM, PROC, or REPORT. Notice that REPORT is an object that you can EXPORT but not IMPORT. You may also EXPORT DATA, but there is an additional data format clause that must be specified as either IXF or QMF. The IXF format should be used to export data to products other than QMF. For example: EXPORT DATA TO EXPDATA (DATAFORMAT=IXF

Now let us turn to the PRINT command. It can be used to PRINT a QUERY, FORM, PROC, PROFILE, or REPORT either from temporary storage or from the database. Its most common use is to PRINT a REPORT that has been created by running a QUERY or PROC. The format for the command is: PRINT REPORT (DATETIME=NO

We have included one of the PRINT commands options, DATET1ME. If your report does not specify that you want both the date and time in its heading or text, DB2 automatically prints the system date and time in the footing. You can suppress this with DATETlME=NO, as we have in our example. Similarly, if you do not specify that you want a page number, a page number will be automatically printed. You can suppress this with PAGENO=NO.

The ERASE command should be used with care. It is used to erase permanent objects, that is, QUERY, FORM, PROC, or TABLE. This example erases a FORM called MYFORM: ERASE FORM MYFORM (CONFIRM=YES

The object type, in this example FORM, is optional, as is the confirm clause. You may only erase objects for which you have the necessary authority.

The QMF RETRIEVE command is quite similar to the RETRIEVE command of ISPF. It is used to redisplay the last command entered at the command prompt. A question mark may be used for the same purpose. Up to 22 RETRIEVES or will recall commands entered that many generations back.

QMF also has a very thorough set of Help panels which you can access by using the HELP PF key or by issuing the HELP command on the command line.


QMF keeps information about QUERYs, FORMS, and PROCs in tables called Q.OBJECT_DIRECTORY and Q.OBJECT_DATA. It keeps a separate table, Q.PROFILES, for information about PROFILES and uses the Catalog tables for information about TABLES, the permanent objects for DATA. The LIST command retrieves information from these tables. Its format is LIST followed by an object type or the word ALL, meaning all object types. There is also an optional OWNER clause to limit the list to those objects owned by specific user IDS and a NAME clause to limit the list to objects of specific names. ALL may be specified for either. The default OWNER is the signed-on user ID and the default for NAME is ALL. Here is an example of the LIST command:


This example will produce a fist of all QUERYs, FORMS, PROCs, and TABLES whose owner is USER1 and have names beginning with the characters MY. We have used the percent sign as a wild card for the NAME option. The wild card underscore ( _ ) may also be used. The percent sign indicates any number of characters, while the underscore indicates a single character. This, you may remember, is the same as SQL's use of wild cards on the LIKE clause. You may also use wild cards for the OWNER option. The most recently generated list is kept in temporary storage until a different LIST command is issued. Therefore, if you have already issued a LIST command and you want to go back and look at the results again, you may reissue it by simply typing LIST, with no other specifications.

The QMF Command column on the Data Base Object List is used to execute commands specific to a particular object. Some of the commands that may be specified here are DISPLAY, ERASE, EXPORT, IMPORT, RUN, and SAVE. You can type a command across the entire width of the screen, overlaying portions of the list. The same syntax rules and options apply for each command as they did for execution from the command line. Since the object name for the command is indicated by the placement of the command on the same line, you can use a slash (/) in place of it. For example you could type the following command on the MYQUERY line:


This would execute the query and use the values in MYFORM to format the report. After you have viewed the report, you can type LIST on the command line of the Report Panel to return to the Data Base Object List. An asterisk will be inserted at the beginning of the QMF Command column on MYQUERY's line to indicate that an action was just performed on that object.

It is sometimes difficult to fit a command and its parameter on one line or on the command line of a panel. It is useful, therefore, to know the acceptable abbreviations for QMF commands. There is, unfortunately, no particular rhyme or reason to the abbreviation scheme that is used by the product. In fact. the same word may be abbreviated one way on one command and a different way with another command. For example, the shortest abbreviation for CONFIRM is C when used with EXPORT, CON when used with IMPORT, and CO when used with SET PROFILE. We have seen an overview of QMF and its basic functions. Now we will see a brief overview of DB2I and its various features,

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics