Using QMF services to handle printing on VSE

To use QMF services to handle printing, specify the type of storage you want to use and provide CICS with a name for the storage.

Choosing between temporary storage queues and transient data queues

CICS temporary storage queues are limited to 32, 767 rows of output. They route data only to local print destinations. If you use temporary storage, you need to write a program that routes the data from the queue to the VSE POWER LIST queue.

CICS transient data queues are limited only by the amount of storage associated with the CICS DCT before CICS is started. You can define the transient data queue as an intrapartition or extrapartition data queue. You can use transient data queues to print data to a file, SYSLST, or SYSPCH. A transient data queue that you define as an intrapartition data queue is limited to 32,767 rows and can only be used to print data to a file.

Using the PRINT command to route output to queues

You can specify on the QMF PRINT command both the name of the queue and the type of storage defined for that queue. For example, to print a report to a temporary storage queue named XYZ, enter this command:

PRINT REPORT (QUEUET=TS,QUEUEN=XYZ

To print from a transient data queue named XYZ, you can enter the following command. Ensure that the transient data queue is defined to CICS before its first use.

PRINT REPORT (QUEUET=TD,QUEUEN=XYZ

QUEUET and QUEUEN are abbreviations for QUEUETYPE and QUEUENAME.

QMF issues an ENQ statement on the queue name to prevent writing to the queue if another program is using it. If the name is already enqueued by another application, CICS indicates to QMF that the queue is unavailable at that time. Use the SUSPEND (S) keyword to tell QMF what to do when the queue is unavailable. Use the value YES (or Y) to hold the report until the queue is available, then write to it. For example:

PRINT REPORT (QUEUET=TS,QUEUEN=XYZ,S=YES

The value NO is the default and cancels the PRINT command, returning a message to the user.

Using global variables to define queues for printing

If you do not specify a value on the PRINT command, QMF uses values stored in the global variables DSQAP_CICS_PQNAME and DSQAP_CICS_PQTYPE.

Set the global variable DSQAP_CICS_PQTYPE to TS if you are using temporary storage queues for printing, and TD if you are using transient data queues. TS is the default.

Use the global variable DSQAP_CICS_PQNAME to define the name of the temporary storage or transient data queue. Names for transient data queues can be from 1 to 4 bytes. Names for temporary storage queues can be from 1 to 8 bytes. The default temporary storage queue name is DSQPnnnn, where nnnn is the user's 4 byte CICS terminal ID. For example, DSQPA085 is a valid name.

Printing to VSE POWER using QMF

You can print to a POWER-controlled printer using QMF. To do this, you need to write a program (see Figure xx on page 127) that segments the POWER output queue. You also need a QMF procedure to execute the QMF PRINT command and execute a CICS transaction that will execute the program. You can then run the QMF procedure using the PRINT PF key from the QMF Report screen.

You need to customize your CICS startup JCL, the DCT, and your synonym and function key tables to print using the LST POWER queue. (In your JCL and DCT entries, you may modify the references to POWER printer 04E, print class P, and logical unit SYS097, to values that are appropriate for your installation. Be sure that you make the modifications to all of the steps. Remember that printer 00E (usually print class A and logical unit SYSLST) is not recommended for QMF printing, because CICS statistics are routed there and would be segmented with your QMF report.

Modifying your CICS startup JCL

The following POWER LST statements need to be in the CICS startup JCL. 04E is the printer address for the QMF output:

*$$LST LST=04E,CLASS=P

Include the following assignment in the CICS startup JCL:

//ASSGNSYS097,04E

You do not need printer DLBLs/EXTENTs in the CICS startup JCL for the QMF printer destination.

Modifying your synonym and function key tables

Run the job shown in Figure 127 to create and initialize two tables. The tables define a user-defined command synonym and a function key setting.

Ensure that column definitions that can contain nulls are not changed to NOT NULL, or QMF will not process the table entry properly.

Figure 127. User-defined command synonym and function key setting
* $$ JOB JNM=QMFPRINT,CLASS=0
* $$ LST CLASS=A
// JOB QMFPRINT SQL TABLES
// LIBDEF *,SEARCH=PRD2.SQL340
// EXEC ARIDBS
CONNECT Q IDENTIFIED BY ????????;    -- MODIFY PASSWORD
SET AUTOCOMMIT ON;
--
CREATE TABLE Q.UTM_SYN
  (VERB                CHAR(18)    NOT NULL,
   OBJECT              VARCHAR(31)         .
   SYNONYM_DEFINITION  VARCHAR(254)NOT NULL)
   IN PUBLIC.TEMP1;
--
CREATE UNIQUE INDEX Q.UTM_SYN_IDX1 ON Q.UTM_SYN (VERB, OBJECT);
--
GRANT SELECT ON Q.UTM_SYN TO PUBLIC;
--
INSERT INTO Q.UTM_SYN
  (VERB,SYNONYM_DEFINITION)
   VALUES ('SYSPRINT','RUN PROC Q.SYSPRINT_PROC');
--
CREATE TABLE Q.UTM_PFK
  (PANEL              CHAR(18)    NOT NULL,
   ENTRY_TYPE         CHAR(1)     NOT NULL,
   NUMBER             SMALLINT    NOT NULL,
   PF_SETTING         VARCHAR(254)        )
   IN PUBLIC.TEMP1;
--
CREATE UNIQUE INDEX Q.UTM_PFK_IDX1 ON Q.UTM_PFK
   (PANEL, ENTRY_TYPE, NUMBER);
--
GRANT SELECT ON Q.UTM_PFK TO PUBLIC;
--
INSERT INTO Q.UTM_PFK
   (PANEL, ENTRY_TYPE, NUMBER, PF_SETTING)
    VALUES ('REPORT', 'K',2,'SYSPRINT');
--
INSERT INTO Q.UTM_PFK
   (PANEL, ENTRY_TYPE, NUMBER, PF_SETTING)
    VALUES ('REPORT', 'L',1,
    '1=Help 2=Sys Print 3=End 4=Dflt Print 5=Chart 6=Query');
/*
/&
* $$ EOJ
Sample program to segment POWER output

The CICS program shown in Figure 43 on page 127 issues the POWER SEGMENT macro. You need to add a PCT entry for transaction S04E and a PPT entry for assembler program SAMSEGMP. This is command-level assembler, so TWASIZE is zero in the PCT. This program segments the 04E POWER printer output.

Figure 128. Program to issue the POWER segment MACRO
* $$ JOB JNM=SAMSEGMP,CLASS=0,DISP=D
* $$ LST CLASS=A
// JOB SAMSEGMP ASSEMBLER CMD LEVEL CICS
// LIBDEF PAHASE,CATALOG=????.??????     -- your target library
* ***************************************
* STEP 1: CICS COMMAND LEVEL TRANSLATION
* ***************************************
// DLBL IJSYSPH,'ASM.TRANSLATION',0,SD
// EXTENT SYSPCH,1,0,??????,????       -- specify start, length
ASSGN  SYSPCH,DISK,VOL=DOSRES,SHR
// EXEC       DFHEAP1$,SIZE=512K
*ASM      XOPTS(NOEPILOG)
******************************************************************
*                                                                *
* PROGRAM NAME:  SAMSEGMP                                        *
* TRANSID:       S04E                                            *
*                                                                *
* PURPOSE:       SEGMENT POWER-CONTROLLED PRINTER OUTPUT.        *
*                TRANSID IDENTIFIES THE DCT TYPE=EXTRA ENTRY     *
*                THAT CORRESPONDS TO A SPECIFIC SYSTEM PRINTER.  *
*                                                                *
* NOTES:         STARTED BY QMFE, T0 RUN AS ASYNC TRANS.         *
*                THEREFORE, NO TERMINAL MESSAGES ARE DISPLAYED.  *
******************************************************************
        EJECT
* ***************************************************************
* REGISTER USAGE
* ***************************************************************
* 
R1     EQU    1
R2     EQU    2
R11    EQU    11              EXEC INTERFACE BLOCK
R12    EQU    12              PROGRAM BASE
R13    EQU    13              EIB DYNAMIC STORAGE
*
* ******************************************************************
* PROGRAM ENTRY
* ******************************************************************
*
SAMSEGMP DFHEIENT DTATREG=R13,CODEREG=R12,EIBREG=R11
*
         B    STRT                  ==> BRANCH AROUND
         DC   CLB'SAMSEGMP'         PROGRAM NAME.
         DC   CLB '01/20/94'        LAST MOD DATE.
STRT     DS   0H
         EXEC CICS ENQ RESOURCE(EIBTRNID) LENGTH(4).
         MVC  USERNM(8),BLANKS   * CLEAR SAVE AREA * 9/94
         EXEC CICS RETRIEVE INTO(USERNM) LENGTH(USERLEN)
         MVC  JOBJECL,JOBINIT
         MVC  JOBJECL+13(8),USERNM  * MOVE QMF SUERID TO JOB STATEMENT
*
         CLC  EIBTRNID,=C'S04E'     SEGMENT LST=04E ?
         BE   SEG04E
         DC   H'0'                  ABEND IF NOT 04E.
*
SEG04E   DS   0H
         SEGMENT DEVADDR=SYS097,JECL=JOBJECL
         SEGMENT DEVADDR=SYS097,JECL=S04EJECL
         B    DONE
DONE     DS   0H
         EXEC CICS DEQ RESOURCE(EIBTRNID) LENGTH(4).
         EXEC CICS RETURN.
*
S043JECL DC   CL71'* $$ LST LST=04E,CLASS=P'
JOBINIT  DC   CL71'* $$ JOB JNM=
JOBJECL  DS   CL71
USERNM   DS   CL8
BLANKS   DC   CL8'
UERLEN   DC   H'8'
*
         LTORG ,
*
**********************************************************************
         SPACE
         END SAMSEGMP
/*
* ********************************************************************
* STEP 2: ASSEMBLE PRINT SEGMENTING PROGRAM
* ********************************************************************
CLOSE SYSPCH.00D
// DLBL   IJSYSIN,'ASM.TRANSLATION',0,SD
// EXTENT SYSIPT
ASSGN SYSIPT,DISK,VOL=DOSRES,SHR
// OPTION CATAL
   PHASE SAMSEGMP,*
         INCLUDE DFHEAI
         INCLUDE DFHEAI0
// EXEC ASSEMBLY
CLOSE SYSIPT,SYSRDR
/*
* ********************************************************************
* STEP 3: LINKEDIT PRINT SEGMENTING PROGRAM
* ********************************************************************
// EXEC LNKEDT
/*
?&
* $$ EOJ
Creating the QMF procedures

Create two procedures to send your report to a specified printer.

The first procedure is:

SET GLOBAL (Q='
RUN Q.SYSPRINT_PROC2

Save the procedure using SHARE=YES to enable your users to access the segmenting program.

SAVE PROC AS Q.SYSPRINT_PROC (SHARE=YES

Create the following two-line QMF procedure. The first line is a QMF command; the second line causes QMF to start the transaction S04E asynchronously. After QMF routes a report to the printer destination, transaction S04E causes POWER to segment the output and print it immediately. Without segmentation, you do not get the printout until CICS is shut down (like waiting for CICS STATS).

PRINT REPORT (QUEUENAME=S04E QUEUETYPE=TD LENGTH=62 WIDTH=132
CICS S043 (FROM=&Q&DSQAO_CONNECT_ID&Q)

Save the procedure using SHARE=YES:

SAVE PROC AS Q.SYSPRINT-PROC2 (SHARE=YES
Modifying your user's profile

Modify your user's profile to ensure that the SYNONYM column name is the name of the created synonym table (Q.UTM_SYN) and the PFKEY column name is the name of the created function key table (Q.UTM_PFK). To update one or more profiles in the QMF control table Q.PROFILE, run an SQL command. For example, to enable JONES to use the synonym, run the following command:

UPDAE Q.PROFILES
   SET SYNONYM = 'Q.UTM_SYN',
       PFKEYS  = 'Q.UTM_PFK'
       WHERE CREATOR = 'JONES'
Using your new print procedure

To produce the startup JCL and DCT changes, you need to cycle CICS. (Recycling CICS also replaces your old PCT and PPT tables with your changed tables, unless you used CEDA.) All other changes can be made before or after CICS is cycled, but we suggest that you do the table definition job and the segmentation program assembly before restarting CICS. Also, if a user is using QMF when the profile is updated, the changes will not take effect until the user exits QMF and starts a new session. You can test your changes as follows:

  1. User logs on to QMF, runs a query, and the report screen is displayed
  2. User sees customized function key line and presses PF2 (instead of PF4)
  3. QMF associates PF2 with the synonym SYSPRINT
  4. Synonym SYSPRINT becomes the command RUN PROC Q.SYSPRINT_PROC
  5. Q.SYSPRINT_PROC issues a global, then invokes Q.SYSPRINT_PROC2
  6. Q.SYSPRINT_PROC2 issues the print report command
  7. Q.SYSPRINT_PROC2 also starts transaction S04E to segment printer
  8. User sees message:
    OK, Your procedure was run.
[ Previous Page | Next Page | Contents | Index ]