The QMF batch query/procedure application is designed to minimize the amount of effort involved and knowledge required to run a query or procedure in batch mode. To use the application, you must start QMF under ISPF.
If you are using an NLF: You need to assign the translated synonym to the users. They then issue the translated command synonym for BATCH. Refer to Customizing QMF Commands for the procedure on how to assign synonyms.
Any QMF user can use the application, since starting it consists of running a shared procedure. The application creates the procedure and JCL for the user's batch job, but it is not able to submit the job unless the user has authority to use the TSO FIB (foreground-initiated background) commands. A TSO administrator grants the user this authority.
The batch job is run under the user's TSO logon ID, so the commands issued by the batch procedure are run under the user's authorization ID. The same rules apply to a batch job and to the user running the job interactively:
Before starting the application, the user must have the query or procedure available to be run, and, if necessary, a form to format the report. These objects can be either in the database or in temporary storage. If the objects are in the database, they can be owned by others, provided they are shared.
After the user fills in the appropriate fields and presses ENTER, the application composes a batch job and submits it to the background.
While the prompt panel is displayed, the user can:
(The function key settings appear at the bottom of the prompt panel.)
If you are using an NLF: Issue the translated command synonym for BATCH to run a query or procedure in batch mode. For example, the translated German command synonym for BATCH is STAPEL. For the translated command synonym for BATCH in the other language environments, see the Q.COMMAND__SYNONYM__n control table.
The application must be invoked while its user is operating under QMF. When invoked, the application prepares a batch job for the user and submits it to the background. The job is prepared from information the user enters on a prompt panel. It runs a single query or procedure of the user's choice. Assuming the batch job is a select query, the job can also:
The advantage to using the application lies in its prompt panel, where the user outlines what the job should do and leaves the details of how to do it to the application. The user does not need to know JCL or QMF procedures.
To use the batch application, enter:
BATCH
which results in the display of the prompt panel in Figure 248
A user can get help filling out the prompt panel by pressing function key 1, which results in the display of the first of three help panels.
QMF BATCH QUERY/PROC BATCH PROMPT OBJECT NAME ===> Name of query or procedure Current OBJECT ===> NO Use object in temporary storage? QUERY or PROC ===> QUERY PROC arguments ===> FORM NAME ===> Form to be used with query Current FORM ===> NO Use form in temporary storage? BATCH NAME ===> Name of QMF batch execution proc DB2 SUBSYSTEM ===> DB2 PLAN ===> LOGON PASSWORD ===> TSO logon password LOGGING ===> YES Log messages and commands? SAVE DATA ===> Name of data to be saved REPORT DATASET ===> NEW DATASET ===> Is the data set new? VOLUME ===> Optional if NEW or uncataloged REPORT WIDTH ===> 133 Width of report line VIEW REPORT ===> YES Should report be printed? OUTPUT CLASS ===> A Class for PRINT and TRACE DISTRIBUTION Enter userids and nodes to send report. USERID ===> NODE ===> ===> ===> PF1=Help PF3=End Enter=Process batch request
Certain fields on the batch prompt panel are mandatory. Messages are displayed prompting the user to enter values for these required fields if the Enter key is pressed before values are provided. The cursor is then positioned on the field requiring input. Table 85 describes the required fields.
Field | Description |
---|---|
OBJECT NAME | A value is required for the name of the query or procedure to be run in batch mode. If the query or procedure is currently in temporary storage, it is saved in the database using this name. If the name is that of an existing object, the new object replaces the old one. (The name must be unqualified.) If the object is in the database, enter the name under which it was saved. (The name must be qualified if the object is owned by someone else and shared.) Save this object using CONFIRM = NO as a profile setting. |
QUERY or PROC | The object type to be run in batch; must be either QUERY or PROC. |
BATCH NAME | A value is required for the name of the QMF procedure to be run in batch mode. (The name is not qualified.) If you are submitting multiple queries, you need to modify the BATCH NAME field for each query or the new batch job replaces the old job. This procedure contains the appropriate QMF commands depending upon the user's input. The user's query or procedure, specified in the QUERY or PROC field, is run from this procedure. The procedure is saved using the SHARE = YES keyword option. It must be able to be run by the batch machine. Save this procedure using CONFIRM = NO as a profile setting. |
Table 86 describes the remaining (optional) entry fields on the panel. Where a value of YES or NO is expected, a default YES or NO normally appears on the screen. If a user blanks out a value in a YES/NO field, the user is prompted for an entry.
Field | Description |
---|---|
Current OBJECT | If the batch query or procedure is currently in temporary storage, the user enters YES in this field. The query or procedure is then saved to be run later in batch. If the query or procedure is in the database, enter NO. The default value for this field is NO. |
Arguments to the REXX procedure named in the OBJECT NAME field. | |
PROC ARGUMENTS | Through this field, you can pass arguments to the REXX procedure specified in the OBJECT NAME field. |
FORM NAME | To run the batch query using a form, the user must specify
the name of a form in this field. If the form to be used:
If you enter the name of an existing form, the new form replaces the old. |
Current FORM | If the batch form is the current form, the user enters YES in this field. The form is then saved for use later in batch. If the form is in the database, enter NO. The default value for this field is NO. |
DB2 SUBSYSTEM | Enter the name of the DB2 subsystem that QMF uses; it has the same value as program parameter DSQSSUBS. |
DB2 PLAN | Enter the name of the QMF application plan; it has the same value as program parameter DSQSPLAN. |
LOGON PASSWORD | Enter your logon password; it does not appear on the screen. |
LOGGING | The default value for this field is YES. This means that the default trace level in batch mode is L2, which traces messages and commands. If the user does not want tracing at the L2 level, NO should be specified. Tracing does not continue in the batch procedure beyond the SET PROFILE (TRACE=NONE command, which is then in the generated user procedure. |
SAVE DATA | If the user wants the data resulting from running a query or procedure to be saved, a value must be given for this field. The DATA is saved as a new table using this name and the CONFIRM=NO keyword option. |
REPORT DATASET | If you want the report to be written to a permanent data
set, enter the name of that data set here. The name must be fully qualified.
If you do not want this done, leave the field empty.
This data set name is passed to OS/390 JCL and must conform to the OS/390 naming conventions. Fully qualified names do not require quotation marks if the name does not contain any special characters other than period, @, #, $. If quotation marks are used, OS/390 assumes that special characters are used and does not catalog the data set in the system catalog. |
NEW DATASET | You must enter something in this field if you entered a data set name in REPORT DATASET. Enter YES to show that this data set does not currently exist. Enter NO to show that the data set does currently exist. |
VOLUME | You can optionally fill this field if you entered YES in the NEW DATASET field. Enter the serial number of a volume on which the new data set can reside. The volume must be one that can be used on a unit of the SYSDA class, as defined by your installation. |
REPORT WIDTH | If you entered YES in the NEW DATASET field, you must fill in this field. Its value becomes the logical record length (LRECL) of the new data set. If the width of your report is less than or equal to the LRECL, use the default value of 133. |
VIEW REPORT | This field must contain YES or NO. YES indicates print the job; NO indicates do not print the job. |
OUTPUT CLASS | Enter the output class for the printed output from your
job. The printed output includes:
|
DISTRIBUTION USERID and NODE | If the user wants the resulting report to be sent to other
users, the user must enter their user IDs and nodes in these fields. To use
the fields, you need to name a data set for the report output in the REPORT
DATASET field.
On the same line, enter a user's logon ID in one of the USERID fields and the user's node in the corresponding NODE field. In this way, you can specify up to two recipients for the report. The report is sent using the TSO TRANSMIT command. You need not fill in the NODE field for a given user if that information is in your NAMES.TEXTLIST data set. The node ID you write might correspond to an entire list of names in this file, allowing you to send the report to more than just two people. |
You can modify the batch application by making changes to its components or creating new components for the customized application. Create new components, so you do not risk losing your changes when maintenance is performed.
To modify the batch application, you need to be aware of the following components in the QMF libraries:
When users call the batch application with the BATCH command, they actually call DSQABB11. The purpose of this CLIST is to call DSQABB12 through the ISPF SELECT service as a new application. Most of the logic in the application is in DSQABB12.
These messages appear on the user's screen after the application ends. The application generates these messages using the QMF MESSAGE command.
You can make the following changes to the application:
Within the model file DSQABB1J is the ISPSTART statement to call batch-mode QMF. This statement does not provide a value for the DSQSSUBS parameter of QMF. As a result, the DB2 subsystem under which QMF is to run is assumed to have the name DSN. If you want QMF to run in a DB2 subsystem with a different name, add DSQSSUBS=xxx to the PARM operand of the ISPSTART command (where xxx is the appropriate subsystem name).
For example, you might offer the user a list of acceptable volumes when the user creates a new data set for the report output.
You can do either of the following:
You might also have to make additional changes such as:
Important: Users who call the batch application should not maintain a data set named userid.DSQ1EBFT.PROC, where userid is the user's TSO logon ID. If such a data set is maintained, the QMF batch application might not run correctly.
The following example shows one way you can modify the BATCH application.
Modify the batch application with all users having the same PROFILE PREFIX, and assume that all users have unique user IDs. Add the user IDs to the data set names using &SYSUID and &ZUSER.
You need to make three modifications to DSQABB1S SKELETON. Figure 249 shows the required changes. The old lines are commented out. The new replacement lines follow them.
)CM ------------------------------------------------------------------- )CM FILE: DSQABB1S )CM DESCRIPTION: THIS SKELETON CREATES DSQABB1S, THE PROC WHICH )CM SAVES THE CURRENT FORM (IF SPECIFIED) )CM IMPORTS AND SAVES THE PROC WHICH RUNS THE QUERY )CM SENDS THE QMF INVOCATION JOB TO OS/390 BATCH )CM RESETS THE PROC ITEM )CM FREES ISPFILE USED FOR FILE TAILORING )CM DISPLAYS THE QUERY PANEL )CM ------------------------------------------------------------------- )SEL &FAN = &YES &SAVE &FORM &AS &FNAME (&SHARE=&YES, &CONFIRM=&NO )ENDSEL )CM &IMPORT &PROC &FROM '&ZPREFIX..DSQ1EBFT.&PROC.' (&MEMBER = DSQABB1P &IMPORT &PROC &FROM '&ZPREFIX..&ZUSER..DSQ1EBFT.&PROC.' (&MEMBER = DSQABB1P &SAVE &PROC &AS &PNAME (&CONFIRM=&NO )CM TSO SUBMIT '&ZPREFIX..DSQ1EBFT.&PROC.(DSQABB1J)' TSO SUBMIT '&ZPREFIX..&ZUSER..DSQ1EBFT.&PROC.(DSQABB1J)' TSO FREE FILE(ISPFILE) DELETE &RESET &PROC )CM &IMPORT &PROC &FROM DSQABB &IMPORT &PROC &FROM &ZUSER..DSQABB )SEL &ITM = &QUERY &DISPLAY &QUERY )ENDSEL
Make the five modifications to DSQABB12 CLIST as commented in Figure 250.
/****************************************************************/ 00088000 /* ALLOCATE USERID.DSQ1EBFT.PROC TO BE USED FOR ISPF */ 00089000 /* FILE TAILORING OUTPUT. */ 00090000 /****************************************************************/ 00091000 FREE FILE(ISPFILE) 00092000 /* ALLOC DDNAME(ISPFILE) DSNAME(DSQ1EBFT.&PROC) OLD 00093000 ALLOC DDNAME(ISPFILE) DSNAME(&SYSUID..DSQ1EBFT.&PROC) OLD 00093000 IF &LASTCC <> 0 THEN + 00094000 DO 00095000 FREE ATTRLIST(ATTRPDS) 00096000 ATTR ATTRPDS LRECL(80) RECFM(F B) BLKSIZE(800) DSORG(PO) 00097000 /* ALLOC DDNAME(ISPFILE) DSNAME(DSQ1EBFT.&PROC) NEW SPACE(5,2) + 00098000 /* TRACKS DIR(10) USING(ATTRPDS) CATALOG 00099000 ALLOC DDNAME(ISPFILE) DSNAME(&SYSUID..DSQ1EBFT.&PROC) NEW + 00098000 SPACE(5,2) TRACKS DIR(10) USING(ATTRPDS) CATALOG 00099000 END 00100000 IF &RC = 8 THEN + 00101000 DO 00102000
·
·
·
/************************************************************/ 00203000 /*EXPORT CURRENT CONTENTS OF PROC PANEL */ 00204000 /************************************************************/ 00205000 ISPEXEC SELECT PGM(DSQCCI) + 00206000 /* PARM( &EXPORT &PROC &TO DSQABB (&CONFIRM = &NO ) 00207000 PARM( &EXPORT &PROC &TO &SYSUID..DSQABB (&CONFIRM = &NO ) 00207000 IF &LASTCC <> 0 THEN DO 00208000 ISPEXEC SELECT PGM(DSQCCI) + 00209000 PARM(SET GLOBAL (DSQEC__NLFCMD__LANG = &LOCLANG )) 00210000 SET &MSG = &DSQB.023 00211000 ISPEXEC SELECT PGM(DSQCCI) PARM( &MESSAGE &MSG ) 00212000 SET &RCDE = 8 00213000 GOTO CLEANUP 00214000 END 00215000
·
·
·
/************************************************************/ 00244000 /* IMPORT AND RUN FILE TAILORED SKELETON */ 00245000 /************************************************************/ 00246000 ISPEXEC SELECT PGM(DSQCCI) + 00247000 /* PARM( &IMPORT &PROC &FROM DSQ1EBFT (&MEMBER = DSQABB1S ) 00248000 PARM( &IMPORT &PROC &FROM &SYSUID..DSQ1EBFT (&MEMBER = DSQABB1S ) 00248000 IF &LASTCC <> 0 THEN + 00249000
·
·
·
CLEANUP: FREE FILE(ISPFILE) DELETE 00274000 DONE: SET &ZPLACE = &SAVEPLC 00275000 SET &ZPFCTL = &SAVEPFC 00276000 SET &ZPF01 = &STR(&SAVEPF01) 00277000 SET &ZPF13 = &STR(&SAVEPF13) 00278000 SET &ZPF03 = &STR(&SAVEPF03) 00279000 SET &ZPF15 = &STR(&SAVEPF15) 00280000 SET &ZPF10 = &STR(&SAVEPF10) 00281000 SET &ZPF22 = &STR(&SAVEPF22) 00282000 SET &ZPF11 = &STR(&SAVEPF11) 00283000 SET &ZPF23 = &STR(&SAVEPF23) 00284000 ISPEXEC VPUT (ZPLACE ZPFCTL ZPF01 ZPF13) PROFILE 00285000 ISPEXEC VPUT (ZPF03 ZPF15 ZPF10 ZPF22 ZPF11 ZPF23) PROFILE 00286000 /* DELETE DSQABB.&PROC 00287000 DELETE &SYSUID..DSQABB.&PROC 00287000 EXIT CODE(&RCDE) 00288000