You are on page 1of 27

tutor07.

doc

Tutorial 7
MQSeries
Copyright Abt. Computersysteme, Institut fr Informatik, Universitt Leipzig In this exercise, we design a message queue, send a messages and read it back again.
Note: This tutorial was generated with the user-ID "PRAKT20". In all file names, you must replace "PRAKT20" by your own user-ID. Moreover, PRAKTxx is used often in the text below, whereby the xx should be your user ID.

Exercise: Work through the following tutorial

MQSeries
For commercial Messaging and Queuing, MQSeries represents a platform independent Middleware-product. It is used especially in high speed - implementations of distributed applications. MQSeries is popular, because it is possible to develop and test MQSeries applications with a minimum amount of time and resources. Since MQSeries is capable of running on many different platforms, programs can as a result work together over a network of different components, processors, subsystems, operating systems and communication protocols. MQSeries-programs use a consistent application interface (API) on all platforms. Figure 1 shows the main components of a MQSeries application.

Figure a: MQSeries in Action

tutor07.doc

MQSeries enables the communication between different user-programs. Program A generates a message as available and writes its into a Queue. Program B reads this Message from the Queue and processes it. Both programs A and B use a special MQSeries Application program interface (API) in order to write messages into the Queue and/or to read out of the Queue. The MQ Series-API is named Message Queue interface (MQI). It is possible that program B is not running when program A places a message into the Queue. In this case, the Queue stores the message until program B is started and can retrieve it. On the other hand, program A can be inactive when program B retrieves the message out of the Queue. For MQSeries, it is not necessary that both communicating programs must be simultaneously active. MQSeries makes asynchronous processing possible. Before we start, some MQSeries objects and/or definitions must be explained.

Message
A message consists of two parts: - Data that are sent by one program to another. - A message descriptor or message header The message descriptor identifies the messages (with a message ID) and contains guiding information (attributes), as well as a message-type, time-flow, correlation-ID, priority and name of the answer queue. The message length is dependent on the version of MQ Series being used. MQSeries version 5 (for distributed platform) supports a maximal message-length of 100 MByte. On our OS/390 system at the University of Leipzig, MQSeries version 2.1 has been installed and supports messages up to 4 MByte.

Queue Manager
A Queue manager (QMGR) is the MQSeries software, that is assigned to a queue. It administers the objects belonging to MQSeries, especially Queues, Channels, process definitions, and others. In addition, the Queue manager makes the Message Queue Interface (MQI) available. An application the MQI to access queues and messages contained therein. The MQI implements a simple application program interface that is identical for all supported platforms. Through the MQI, the applications are separated from the Queue manager. An application must establish a communication with the Queue manager before it can access its resources. For this it uses the commands MQCONN or MQCONNX. If the application no longer requires a connection to the Queue manager, MQDISC is used to disconnect, In order to access a Queue, an application must first open this Queue. This is done by means of the MQOPEN call. With MQCLOSE, the Queue is closed again. With a queue opened, the application uses the command MQPUT in order to write a message into a Queue. With the call MQGET, a message can be read out of the Queue. By
2

tutor07.doc

means of the call MQPUT1, an application can, in one step, open a queue, write messages into the Queue and close the Queue again. Queue, Queue manager and processes are examples of MQSeries objects. When installating MQSeries on a server, the Queue manager must be setup by a systems programmer. The name of the Queue manager in our OS/390 MQSeries-installation is MQA1.

Queue
When an application writes a message into a Queue, the Queue manager will assure that the message is savely stored, recoverable and is delivered only once at the receiving end. This also applies if a message must be sent to a Queue of another Queue manager. This mechanism within the framework of MQSeries is called "secured delivery". There are persistent and non-persistent messages. Persistent messages are written in the MQSeries log and are available again after a new start of the QMGRs. Non-persistent messages are no longer available after a new start of the QMGRs. When an application opens a Queue, the Queue manager determines whether we are dealing with a "local Queue" or a "remote Queue". A local Queue is a queue that belongs to the Queue manager which interacts with the application. A Queue is named as "remote" if it belongs to another Queue manager. When an application issues the command MQPUT, the Queue manager writes the message to the local Queue. If it concerns a "remote" Queue, the Queue manager retrieves from its definition the information that is necessary for correct delivery (name of the remote QMGR, name of the remote Queue, name of the associated transmission Queue). The message is placed is into an inbetween-Queue (transmission Queue), and is assigned to the remote QMGR. Subsequently it is the task of the message Channel agent (MCA) to read the message of the transmission Queue and to send it over the network to a receiving MCA. The latter writes the message into the taget-Queue. After this the message in the transmission Queue is deleted. In our exercise, a local Queue must be set up first

tutor07.doc

User Programs
Data exchange between two user-programs takes place via the MQI. The latter represents a call interface with a limited number of calls and extensive options for each call. Preset standard and start values guarantee a quick start. The MQI uses a set of structures and constants. With MQSeries, files and copybooks are included, that contain the definitions of these structures and their fields as well as the definitions of symbolic names, that are used for constants within the program logic. A program talks directly with its Queue manager. It resides on the same processor (or domain for clients) as the program itself. When the connection between a client and its server is interrupted, no API-Calls can be carried out because all objects are on the server. There exist a total of 13 APIs. They are listed in figure 20. The most important APIs are:MQCONN, MQOPEN, MQPUT, MQGET, MQCLOSE and MQDISC.

Figure b: MQSeries APIs

tutor07.doc

These are the individual APIs: MQCONN establishes a connection with a Queue-manager with the help of standard links. MQCONNX: A connection with a Queue-manager over a fast path. Fastpath-PUTs and GETs are faster; the application must however be well tested. The application and the Queue-manager run in the same process. If the application collapses, then the Queuemanager follows. This API-Call is new in MQSeries version 5. Version 5. MQBEGIN: starts a unit of work that is coordinated by the Queue-manager. It may contain external XA-Compatible-resource-managers. This API was introduced with MQSeries version 5. It is used for the coordination of transactions, that use Queues (MQPUT and MQGET under syncpoint-conditions) and database-updates (SQL commands). MQPUT1: opens a Queue, transfers a message and closes the Queue again. This API-Call represents a combination of MQOPEN, MQPUT and MQCLOSE. MQINQ: Requests information over the Queue-manager or over one of its objects, like the number of messages in a Queue. MQSET: Changes some attributes of an object. MQCMIT: Indicates that a Syncpoint was reached. The messages are generated as part of a Unit of Work and are made available for other applications. Returned messages are deleted. MQBACK: Informs the Queue Manager about all returned PUTs and GETs messages since the last Syncpoint. Messages that were generates as part of a Unit of work are deleted. Returned messages are put on the Queue again. MQDISC: includes the transfer of a working unit: The termination of a program without interruption of the connection to the Queue-manager causes a "rollback" (MQBACK). In order to carry out this exercise, it is necessary that the Queue manager has been started. If this is not the case, an authorised user must start the Queue manager in SDSF SYSLOG. The command looks like this: Command Input === > / ! MQA1 START QMGR

tutor07.doc

For our exercise, the following tasks have to be performed: Design local queue Search for Module A (PUT) and B (GET) Design Libraries PRAKTxx.MQA1.USERJCL, which contain the Members MQPUT and MQGET. Rework members MQPUT and MQGET. Execute MQGET and MQPUT. Review result

For the communication of the two user-programs a "local Queue" is required. In order to generate the latter, we select the "MQSeries for OS/390-Main Menu" of the Custompac master application Menu (CMAM). For this we select "m" as an option and press the Enterkey.

CUSTOMPAC MASTER APPLICATION MENU OPTION ===> m

SCROLL ===> PAGE

IS ISMF - Interactive Storage Management Facility P PDF - ISPF/Program Development Facility ATC ATC - Application Testing Collection ART ARTT - Automated Regression Testing Tool DB2 DB2 - Perform DATABASE 2 interactive functions QMF QMF - QMF Query Management Facility C CPSM - CICSPlex/SM M MQ - MQSeries IP IPCS - Interactive Problem Control Facility OS SUPPORT - OS/390 ISPF System Support Options OU USER - OS/390 ISPF User Options SM SMP/E - SMP/E Dialogs SD SDSF - System Display and Search Facility R RACF - Resource Access Control Facility DI DITTO - Data Interfile Transfer, Testing and Operations HC HCD - Hardware Configuration Definition S SORT - DF/SORT Dialogs BMR BMR READ - BookManager Read (Read Online Documentation) F1=HELP F7=UP F2=SPLIT F3=END F8=DOWN F9=SWAP F4=RETURN F5=RFIND F6=RCHANGE F10=LEFT F11=RIGHT F12=RETRIEVE

Figure 1: Screen of CMAM with selected option "m" As a result of our action, the Main Menu of MQSeries appears.

tutor07.doc

IBM MQSeries for OS/390 - Main Menu Complete fields. Then press Enter. Action . . . . . . . . 2 2. Define 3. Alter 4. Delete 1. Display 6. Start 7. Stop 5. Perform

Object type . . . . . QLOCAL + Name . . . . . . . . . PRAKT20 Like . . . . . . . . . ________________________________________________ Connect to queue manager . . . . . . : Target queue manager : Response wait time . : 30

seconds

(C) Copyright IBM Corporation 1993,1999. All rights reserved.

Command ===> __________________________________________________________________ F1=Help F2=Split F3=Exit F4=Prompt F6=QueueMgr F9=Swap F10=Messages F12=Cancel

Figure 2: MQSeries for OS/390 - Main Menu In the Main Menu, we enter in the line "Action" a 2 (Define). As an "Object type" and "name" we enter QLOCAL and/or PRAKTxx. All remaining entries remain as they are. A local Queue is defined with the name "PRAKTxx". The latter belongs to the Queue manager MQA1. Hint: If the error message "CSQO040I Object named PRAKT20 of type QUEUE already exists" appears, then a local Queue already exists with the name PRAKTxx. Please delete the old queue. Input a 4in the Panel "IBM MQSeries for OS/390 - Main Menu" in the line "Action". For "Object type" and "name" enter QLOCAL and PRAKTxx. Assure that both lines marked Queue Manager contain the entry "MQA1". Hitting the entry key three times deletes the Queue. The message: "CSQ9022I! MQA1 CSQMUQLC ' DELETE QLOCAL' NORMALLY COMPLETION" confirms successful deletion. Use the F6 key in order to activate/access Menu changes in the fields "Connect to QMGR" and "Target QMGR" in the Menu. We enter 2 times MQA1 as a Queue manager. (See fig. 3)

tutor07.doc

IBM MQSeries for OS/390 - Main Menu Complete fields. Then press Enter. .-----------------------------------------------------------------------------. | Change the Queue Manager | | | | Make changes and press Enter. | | | | Connect to queue | | manager . . . . . . . MQA1 | | | | | Target queue manager . MQA1 | | | Response wait time . . 30 5 - 999 seconds | | | | | | F1=Help F2=Split F9=Swap F12=Cancel | '-----------------------------------------------------------------------------' (C) Copyright IBM Corporation 1993,1999. All rights reserved.

Command ===> SYSID F1=Help F2=Split F3=Exit F10=Messages F12=Cancel

F4=Prompt

F6=QueueMgr F9=Swap

Figure 3: Change the Queue Manager By hitting the Enter key these values are received. We should see a screen similar to Fig. 4
IBM MQSeries for OS/390 - Main Menu Complete fields. Then press Enter. Action . . . . . . . . 2 2. Define 3. Alter 4. Delete 1. Display 6. Start 7. Stop 5. Perform

Object type . . . . . QLOCAL + Name . . . . . . . . . PRAKT20 Like . . . . . . . . . ________________________________________________ Connect to queue manager . . . . . . : MQA1 Target queue manager : MQA1 Response wait time . : 30 seconds (C) Copyright IBM Corporation 1993,1999. All rights reserved.

Command ===> __________________________________________________________________ F1=Help F2=Split F3=Exit F4=Prompt F6=QueueMgr F9=Swap F10=Messages F12=Cancel

Figure 4: MQSeries Main Menu Subsequently hit the Enter-key. A further Screen appears as a result for the definition of the local Queue.

tutor07.doc

Define a Local Queue Complete fields, then press F8 for further fields, or Enter to define queue. More: +

Queue name . . . . . . . . . PRAKT20 Description . . . . . . . . . ________________________________ ________________________________ Put enabled . Get enabled . Usage . . . . Storage class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y Y=Yes,N=No Y Y=Yes,N=No N N=Normal,X=XmitQ DEFAULT

Command ===> __________________________________________________________________ F1=Help F2=Split F3=Exit F7=Bkwd F8=Fwd F9=Swap F10=Messages F12=Cancel

Figure 5: 2. Define Screen In this Screen, the name of the Queue must be registered (PRAKTxx) once more. To enable Put and Get, we select Y (Yes) for both. All other parameters are entered as shown in figure 5. Subsequently we hit Key F8. The result is a 3 Define Screen (Fig.6) in which in the line "Default persistence" = "N" (No) is entered. A message is called "persistent" if it is still available after a restart of the Queue manager. It doesnt matter whether the Queue manager was stopped by an operator command or stopped by a system error. This means that persistent messages are written into a protocol. If after an error a Queue manager is started again, it reproduces the messages from the protocol data.

tutor07.doc

Define a Local Queue Press F7 or F8 to see other fields, or Enter to define queue. More: - + Default persistence . . . . . N Y=Yes,N=No Default priority . . . . . . 0 0 - 9 Message delivery sequence . . P P=Priority,F=FIFO Permit shared access . . . . N Y=Yes,N=No Default share option . . . . E E=Exclusive,S=Shared Index type . . . . . . . . . N N=None,M=MsgId,C=CorrelId,T=MsgToken Maximum queue depth . . . . . 999999999 0 - 999999999 Maximum message length . . . 4194304 0 - 4194304 Retention interval . . . . . 999999999 0 - 999999999 hours Cluster name . . . . . . . . ________________________________________________ Cluster namelist name . . . . ________________________________________________ Default bind . . . . . . . . O O=Open,N=Notfixed

Command ===> __________________________________________________________________ F1=Help F2=Split F3=Exit F7=Bkwd F8=Fwd F9=Swap F10=Messages F12=Cancel

Figure 6: Input-Parameter im 2. Define Screen A message is considered "not-persistent" if it is no longer available after a restart of the Queue manager. We decide on a not-persistent message for our local Queue "PRAKTxx". The remaining parameters for the 3 Define Screen are entered as shown in Fig. 6
Define a Local Queue Press F7 or F8 to see other fields, or Enter to define queue. More: - +

Trigger Definition Trigger type . . . . . . . . F F=First,E=Every,D=Depth,N=None set . . . . . . . N Y=Yes,N=No message priority . 0 0 - 9 depth . . . . . . 1 1 - 999999999 data . . . . . . . ________________________________ ________________________________ Process name . . . . . . . ________________________________________________ Initiation queue . . . . . ________________________________________________ Trigger Trigger Trigger Trigger

Command ===> __________________________________________________________________ F1=Help F2=Split F3=Exit F7=Bkwd F8=Fwd F9=Swap F10=Messages F12=Cancel

Figure 7: 3. Define Screen Via F8 another three define screens can be called. We do not take advantage of this and hit <Enter> in the 3 define screen.

10

tutor07.doc

As a result of this action, the Screen "display messages" appears. It shows whether the encountered definitions were successful for our local Queue "PRAKTxx" (fig. 7)
Define a Local Queue Complete fields, then press F8 for further fields, or Enter to define queue. More: +

Queue name . . . . . . . . . PRAKT20 Description . . . . . . . . . ________________________________ ________________________________ Put enabled . Get enabled . Usage . . . . Storage class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y Y=Yes,N=No Y Y=Yes,N=No N N=Normal,X=XmitQ DEFAULT

CSQ9022I !MQA1 CSQMMSGP ' DEFINE QLOCAL' NORMAL COMPLETION Command ===> __________________________________________________________________ F1=Help F2=Split F3=Exit F7=Bkwd F8=Fwd F9=Swap F10=Messages F12=Cancel

Figure 8: Display messages As a result of this action, the Screen appears "display messages" that issues, whether the encountered definitions were successful for our local Queue "PRAKTxx" (fig. 8)
IBM MQSeries for OS/390 - Main Menu Complete fields. Then press Enter. Action . . . . . . . . 1 2. Define 3. Alter 4. Delete 1. Display 6. Start 7. Stop 5. Perform

Object type . . . . . QLOCAL + Name . . . . . . . . . P* Like . . . . . . . . . ________________________________________________ Connect to queue manager . . . . . . : MQA1 Target queue manager : MQA1 Response wait time . : 30 seconds (C) Copyright IBM Corporation 1993,1999. All rights reserved.

Command ===> __________________________________________________________________ F1=Help F2=Split F3=Exit F4=Prompt F6=QueueMgr F9=Swap F10=Messages F12=Cancel

Figure 9: MQSeries Main Menu

11

tutor07.doc

This screen lists all local Queues with its definitions that begin with "P". With the key F11, important parameters of the local Queues can be displayed on the screens. The result is shown in figure 10.
List Local Queues Row 1 of 1

Type action codes. Then press Enter. 1=Display 2=Define like 3=Alter 4=Delete

Name Depth Get In Put Out PRAKT20 0 Y 0 Y 0 ******** End of list ********

Command ===> __________________________________________________________________ F1=Help F2=Split F3=Exit F5=Refresh F6=Clusinfo F7=Bkwd F8=Fwd F9=Swap F10=Messages F11=Attrs F12=Cancel

Figure 10: List Local Queues Exercise: Set up a Local Queue with the name PRAKTxx (xx from your user ID) and check whether your Queue was implemented correctly or not. As the next step we generate the source code for the user-programs A and B in the programming language COBOL II. Because we do not presume, that the participant has any COBOL knowledge, we can simply copy the required source code for the programs A (PUT) and B (GET) from the IBM MQSeries library. It will be under the directory MQM.SCSQCOBS. The libraries already exist on the server in compiled form. In order to get an overview of both of the COBOL program modules, we do the following: In the Custompac master application Menu, we enter option P.3.4 and hit the enter key. As a result we obtain the Data List Utility (figure 11)

12

tutor07.doc

Menu RefList RefMode Utilities Help -----------------------------------------------------------------------------Data Set List Utility blank Display data set list V Display VTOC information P Print data set list PV Print VTOC information

Enter one or both of the parameters below: Dsname Level . . . MQM.SCSQCOBS Volume serial . . Data set list options Initial View . . . 2 1. Volume Enter "/" to select option 2. Space / Confirm Data Set Delete 3. Attrib / Confirm Member Delete 4. Total When the data set list is displayed, enter either: "/" on the data set list command field for the command prompt pop-up, an ISPF line command, the name of a TSO command, CLIST, or REXX exec, or "=" to execute the previous command. Option ===> F1=Help F3=Exit

F10=Actions F12=Cancel

Figure 11: Data Set List Utility In this Screen on the line "Dsname level" enter the PDS-name "MQM. SCSQCOBS". This library, together with MQM.SCSQCOBC forms an integral component of MQSeries . The first library contains among others the COBOL II-source program module for PUT and GET (.S -> source, while the second contains the copy book (...C ->Copy). In the line, Initial View, a "2" is entered (Space). Subsequently we hit the Enter-key. The following Screen DSLIST- Data Sets Matching MQM.SCSQCOBS displays the used storage space on a 3390-Device. (figure 12)

13

tutor07.doc

Menu Options View Utilities Compilers Help -----------------------------------------------------------------------------DSLIST - Data Sets Matching MQM.SCSQCOBS Row 1 of 1 Command - Enter "/" to select action Tracks %Used XT Device ------------------------------------------------------------------------------b MQM.SCSQCOBS 44 84 1 3390 ***************************** End of Data Set list ****************************

Command ===> F1=Help F3=Exit

Scroll ===> PAGE F5=Rfind F12=Cancel

Figure 12: DSLIST We enter a "b" (for browse) before the file names MQM. SCSQCOBS and hit the Enter- key. The result screen lists all members of this PDS as shown in Fig.11

Menu Functions Confirm Utilities Help -----------------------------------------------------------------------------BROWSE MQM.SCSQCOBS Row 00001 of 00023 Name Prompt VV MM Changed Size Init Mod ID _________ CSQ4BVA1 _________ CSQ4BVJ1 s________ CSQ4BVK1 _________ CSQ4CVB1 _________ CSQ4CVB2 _________ CSQ4CVB3 _________ CSQ4CVB4 _________ CSQ4CVB5 _________ CSQ4CVC1 _________ CSQ4CVD1 _________ CSQ4CVD2 _________ CSQ4CVD3 _________ CSQ4CVD4 _________ CSQ4CVD5 _________ CSQ4CVJ1 _________ CSQ4CVK1 _________ CSQ4TVD1 _________ CSQ4TVD2 Command ===> Scroll ===> PAGE F1=Help F3=Exit F10=Actions F12=Cancel

Figure 13: Member des PDS MQM.SCSQCOBS When you enter the command "S" (Select) on the line in front of the Member CSQ4BVK1, the source code of this module can be displayed (figure 12). With the keys F8 and F7 we can scroll forwards or backwards.
14

tutor07.doc

Menu Utilities Compilers Help ------------------------------------------------------------------------------BROWSE MQM.SCSQCOBS(CSQ4BVK1) Line 00000000 Col 001 080 ********************************* Top of Data ********************************** CBL NODYNAM,LIB,OBJECT,RENT,RES,APOST * * * ------------------------------------------------------------- * IDENTIFICATION DIVISION. * ------------------------------------------------------------- * PROGRAM-ID. CSQ4BVK1. *REMARKS ***************************************************************** * @START_COPYRIGHT@ * * Statement: Licensed Materials - Property of IBM * * * * 5655-A95 * * (C) Copyright IBM Corporation. 1993, 1998 * * * * Status: Version 2 Release 1 * * @END_COPYRIGHT@ * * * * Module Name : CSQ4BVK1 * Command ===> Scroll ===> PAGE F1=Help F3=Exit F5=Rfind F12=Cancel

Figure 14: 1. Screen des Quellcodes von CSQ4BVK1 By entering F3, one goes back into the list of members for MQM. SCSQCOBS. You can inspect the source code for the members CSQ4BVJ1 by means of the select command on the screen. We now need two JCL scripts in order to send a message to the message queue MQA1 and toreceive a message. Before we copy these two modules, we need to create a private library with the name PRAKTxx.MQA1.USERJCL. We do this as shown in Tutorial 1. Please enter the values as showm in figure 15:

15

tutor07.doc

Menu RefList Utilities Help -----------------------------------------------------------------------------Allocate New Data Set More: + Data Set Name . . . : PRAKT20.MQA1.USERJCL Management class . . . DEFAULT (Blank for default management class) Storage class . . . . PRIM90 (Blank for default storage class) Volume serial . . . . SMS003 (Blank for system default volume) ** Device type . . . . . (Generic unit or device address) ** Data class . . . . . . (Blank for default data class) Space units . . . . . TRACK (BLKS, TRKS, CYLS, KB, MB, BYTES or RECORDS) Average record unit (M, K, or U) Primary quantity . . 3 (In above units) Secondary quantity 1 (In above units) Directory blocks . . 5 (Zero for sequential data set) * Record format . . . . FB Record length . . . . 80 Block size . . . . . 6160 Data set name type : PDS (LIBRARY, HFS, PDS, or blank) * (YY/MM/DD, YYYY/MM/DD Command ===> F1=Help F3=Exit F10=Actions F12=Cancel

Figure 15: Designing a New Data Set This PDS (partitioned data set) should receive the corresponding JCL-Script2 for the PUT and GET jobs. We copy from the PDS MQM.SCSQPROC the Member CSQ4BVJR. This member should be copied twice and named MQPUT and MQGET. We now have a JCL script with the Members MQPUT and MQGET. MQPUT contains the job, that through calling the module CSQ4BVK1 with the corresponding parameters (QMGR, QUEUE, MSGS, PAD, LEN and PERS) writes a message into the local Queue and displays the result on the screen. MQGET implements the job that reads this message through calling the module CSQ4BVJ1 with identical parameters (as MQPUT) from the local Queue and displays the results to the screen. The copying can be done (option P.3.3) by means of the Move/Copy Utility.

16

tutor07.doc

Menu RefList Utilities Help -----------------------------------------------------------------------------Move/Copy Utility More: + C Copy data set or member(s) CP Copy and print M Move data set or member(s) MP Move and print L Copy and LMF lock member(s) LP Copy, LMF lock, and print P LMF Promote data set or member(s) PP LMF Promote and print Specify "From" Data Set below, then press Enter key From ISPF Library: Project . . . (--- Options C, CP, L, and LP only ----) Group . . . . . . . . . . . . . Type . . . . Member . . . (Blank or pattern for member list, "*" for all members) From Other Partitioned or Sequential Data Set: Data Set Name . . . 'MQM.SCSQPROC(CSQ4BVJR)' Volume Serial . . . (If not cataloged) Option ===> C F1=Help F3=Exit

F10=Actions F12=Cancel

Figure 16: Kopieren von CSQ4BVJR We input the values as indicated above, hit the Enter-key and arrive at the following Screen:

Menu RefList Utilities Help -----------------------------------------------------------------------------COPY From MQM.SCSQPROC(CSQ4BVJR) More: + Specify "To" Data Set Below To ISPF Library: Project . . PRAKT20 Replace option: Group . . . MQA1 Enter "/" to select option Type . . . . USERJCL Replace like-named members Member . . . MQGET (Blank unless member is to be renamed) To Other Partitioned or Sequential Data Set: Data Set Name . . . Volume Serial . . . (If not cataloged) Data Set Password . . (If password protected)

To Data Set Options: Sequential Disposition Pack Option SCLM Setting 1 1. Mod 3 1. Yes 3 1. SCLM 2. Old 2. No 2. Non-SCLM Command ===> F1=Help F3=Exit F10=Actions F12=Cancel

Figure 17: Kopieren von CSQ4BVJR nach MQGET We copy the same Member once again, but now store it under PRAKTxx.MQA1.USERJCL.MQPUT

17

tutor07.doc

Exercise: Generate the new Dataset and copy the JCL scripts 2 times (as a MQGET and MQPUT). Now we edit the members MQPUT and MQGET. Both files are JCL scripts that must be adapted for our purposes: We open MQPUT by means of the TSO editor:

File Edit Confirm Menu Utilities Compilers Test Help ------------------------------------------------------------------------------EDIT PRAKT20.MQA1.USERJCL(MQPUT) - 01.00 Columns 00001 00072 ****** ***************************** Top of Data ****************************** ==MSG> -Warning- The UNDO command is not available until you change ==MSG> your edit profile using the command RECOVERY ON. ==MSG> -CAUTION- Profile is set to STATS ON. Statistics did not exist for ==MSG> this member, but will be generated if data is saved. 000001 //****************************************************************** 000002 //* * 000003 //* @START_COPYRIGHT@ * 000004 //* Statement: Licensed Materials - Property of IBM * 000005 //* * 000006 //* 5655-A95 * 000007 //* (C) Copyright IBM Corporation. 1993, 1998 * 000008 //* * 000009 //* Status: Version 2 Release 1 * 000010 //* @END_COPYRIGHT@ * 000011 //* * 000012 //****************************************************************** 000013 //* CUSTOMIZE THIS JCL HERE FOR YOUR INSTALLATION 000014 //* YOU MUST DO GLOBAL CHANGES ON THESE PARAMETERS USING YOUR EDITOR Command ===> Scroll ===> PAGE F1=Help F3=Exit F5=Rfind F6=Rchange F12=Cancel

Figure 18: Source text MQPUT Using the F7 or F8 keys, we can display the source text by scrolling. You can see that the script has plenty of comments. (The actual script has only 8 lines).

18

tutor07.doc

If we go to line 56:
File Edit Confirm Menu Utilities Compilers Test Help ------------------------------------------------------------------------------EDIT PRAKT20.MQA1.USERJCL(MQPUT) - 01.00 Columns 00001 00072 000047 //* - FIRST PARM (++QMGR++) QUEUE MANAGER NAME 000048 //* - SECOND PARM (++QUEUE++) QUEUE NAME 000049 //* - THIRD PARM (++MSGS++) THE NUMBER OF MESSAGES TO GET-(9999) 000050 //* - FOURTH PARM (++GET++) GET TYPE-(B)ROWSE/(D)ESTRUCTIVE 000051 //* - FIFTH PARM (++SYNC++) (S)YNCPOINT/(N)O SYNCPOINT 000052 //* MESSAGES ARE PRINTED TO DD SYSPRINT 000053 //* 000054 //********************************************************************* 000055 //PUTMSGS EXEC PGM=CSQ4BVK1,REGION=1024K, 000056 // PARM=('++QMGR++,++QUEUE++,++MSGS++,++PAD++,++LEN++,++PERS++') 000057 //*GETMSGS EXEC PGM=CSQ4BVJ1,REGION=1024K, 000058 //* PARM=('++QMGR++,++QUEUE++,++MSGS++,++GET++,++SYNC++') 000059 //STEPLIB DD DSN=++USERLIB++,DISP=SHR 000060 // DD DSN=++THLQUAL++.SCSQANL++LANGLETTER++,DISP=SHR 000061 // DD DSN=++THLQUAL++.SCSQAUTH,DISP=SHR 000062 //SYSDBOUT DD SYSOUT=* 000063 //SYSABOUT DD SYSOUT=* 000064 //SYSPRINT DD SYSOUT=* 000065 //SYSOUT DD SYSOUT=* Command ===> Scroll ===> PAGE F1=Help F3=Exit F5=Rfind F6=Rchange F12=Cancel

Figure 19: 2. Screen Quelltext MQPUT The parameters starting at line 56 are very well documented in the script. We replace this line by:
File Edit Confirm Menu Utilities Compilers Test Help ------------------------------------------------------------------------------EDIT PRAKT20.MQA1.USERJCL(MQPUT) - 01.00 Columns 00001 00072 000053 //* 000054 //********************************************************************* 000055 //PUTMSGS EXEC PGM=CSQ4BVK1,REGION=1024K, 000056 // PARM=('MQA1,PRAKT20,3,Z,5,N') 000057 //*PUTMSGS EXEC PGM=CSQ4BVK1,REGION=1024K, 000058 //* PARM=('++QMGR++,++QUEUE++,++MSGS++,++PAD++,++LEN++,++PERS++') 000059 //STEPLIB DD DSN=MQM.MQA1.USERLIB,DISP=SHR 000060 // DD DSN=MQM.SCSQANLE,DISP=SHR 000061 // DD DSN=MQM.SCSQAUTH,DISP=SHR 000062 //SYSDBOUT DD SYSOUT=* 000063 //SYSABOUT DD SYSOUT=* 000064 //SYSPRINT DD SYSOUT=* ****** **************************** Bottom of Data ****************************

Command ===> sub F1=Help F3=Exit

F5=Rfind

Scroll ===> PAGE F6=Rchange F12=Cancel

Figure 20: Neuer Quelltext MQPUT

19

tutor07.doc

This means: 3 messages are written into the local Queue whereby each messages consists of a sequence "ZZZZZ". After editing the parameters, we enter "SUB" on the command line. The command SUB is confirmed by means of Enter and the following screen appears:

20

tutor07.doc

File Edit Confirm Menu Utilities Compilers Test Help ------------------------------------------------------------------------------EDIT PRAKT20.MQA1.USERJCL(MQPUT) - 01.00 Columns 00001 00072 000053 //* 000054 //********************************************************************* 000055 //PUTMSGS EXEC PGM=CSQ4BVK1,REGION=1024K, 000056 // PARM=('MQA1,PRAKT20,3,Z,5,N') 000057 //*GETMSGS EXEC PGM=CSQ4BVJ1,REGION=1024K, 000058 //* PARM=('++QMGR++,++QUEUE++,++MSGS++,++GET++,++SYNC++') 000059 //STEPLIB DD DSN=++USERLIB++,DISP=SHR 000060 // DD DSN=++THLQUAL++.SCSQANL++LANGLETTER++,DISP=SHR 000061 // DD DSN=++THLQUAL++.SCSQAUTH,DISP=SHR 000062 //SYSDBOUT DD SYSOUT=* 000063 //SYSABOUT DD SYSOUT=* 000064 //SYSPRINT DD SYSOUT=* 000065 //SYSOUT DD SYSOUT=* ****** **************************** Bottom of Data ****************************

IKJ56700A ENTER JOBNAME CHARACTER(S) P

Figure 21: sub MQPUT Here we can simply enter P (for Put). Background: the job gets a name that consists of the login (PRAKTxx) and the entered character (above). (Maximally 8 characters). So our job is named PRAKTxxP. We now get the following message:

21

tutor07.doc

File Edit Confirm Menu Utilities Compilers Test Help ------------------------------------------------------------------------------EDIT PRAKT20.MQA1.USERJCL(MQPUT) - 01.00 Columns 00001 00072 000055 //PUTMSGS EXEC PGM=CSQ4BVK1,REGION=1024K, 000056 // PARM=('MQA1,PRAKT20,3,Z,5,N') 000057 //*GETMSGS EXEC PGM=CSQ4BVJ1,REGION=1024K, 000058 //* PARM=('++QMGR++,++QUEUE++,++MSGS++,++GET++,++SYNC++') 000059 //STEPLIB DD DSN=++USERLIB++,DISP=SHR 000060 // DD DSN=++THLQUAL++.SCSQANL++LANGLETTER++,DISP=SHR 000061 // DD DSN=++THLQUAL++.SCSQAUTH,DISP=SHR 000062 //SYSDBOUT DD SYSOUT=* 000063 //SYSABOUT DD SYSOUT=* 000064 //SYSPRINT DD SYSOUT=* 000065 //SYSOUT DD SYSOUT=* ****** **************************** Bottom of Data ****************************

IKJ56700A ENTER JOBNAME CHARACTER(S) P IKJ56250I JOB PRAKT20P(JOB00829) SUBMITTED ***

Figure 22: 2. Screen sub MQPUT We press Enter, until a message is displayed on the screen:
11.51.22 JOB00833 $HASP165 PRAKT20P ENDED AT N1 MAXCC=0 CN(INTERNAL) ***

Figure 23: Ausgabe von sub MQPUT This wrote our messages into the local Queue.

22

tutor07.doc

Now these messages must be retrieved. We edit the Member MQGET from the directory PRAKTxx.MQA1.USERJCL. It is the same JCL script as for MQGET. We scroll with F8 directly to line 56 and replace the line with:

23

tutor07.doc

File Edit Confirm Menu Utilities Compilers Test Help ------------------------------------------------------------------------------EDIT PRAKT20.MQA1.USERJCL(MQGET) - 01.00 Columns 00001 00072 000053 //* 000054 //********************************************************************* 000055 //*PUTMSGS EXEC PGM=CSQ4BVK1,REGION=1024K, 000056 //* PARM=('++QMGR++,++QUEUE++,++MSGS++,++PAD++,++LEN++,++PERS++') 000057 //GETMSGS EXEC PGM=CSQ4BVJ1,REGION=1024K, 000058 // PARM=('MQA1,PRAKT20,3,D,N') 000059 //STEPLIB DD DSN=MQM.MQA1.USERLIB,DISP=SHR 000060 // DD DSN=MQM.SCSQANLE,DISP=SHR 000061 // DD DSN=MQM.SCSQAUTH,DISP=SHR 000062 //SYSDBOUT DD SYSOUT=* 000063 //SYSABOUT DD SYSOUT=* 000064 //SYSPRINT DD SYSOUT=* 000065 //SYSOUT DD SYSOUT=* ****** **************************** Bottom of Data ****************************

Command ===> sub F1=Help F3=Exit

F5=Rfind

Scroll ===> PAGE F6=Rchange F12=Cancel

Figure 24: Neuer Quelltext von MQGET By entering sub we run the script. The jobname should now be PRAKTxxG, therefore enter a G. Exercise: Repeat the scripts MQPUT and after that MQGET again.

After a successful run, we may ask ourselves, what has actually happened: After repeatedly hitting the F3key, we arrive back at the Custompac master application Menu. Subsequently we enter on the line "option" SD and arrive therewith into the SDSF panel.

24

tutor07.doc

Display Filter View Print Options Help ------------------------------------------------------------------------------HQX1900------------------ SDSF PRIMARY OPTION MENU -------------------------DA I O H ST SE END Display active users in the sysplex Display jobs in the JES2 input queue Display jobs in the JES2 output queue Display jobs in the JES2 held output queue Display status of jobs in the JES2 queues Display scheduling environments in the MAS or sysplex - Exit SDSF

Licensed Materials - Property of IBM 5647-A01 (C) Copyright IBM Corp. 1981, 1997. All rights reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

COMMAND INPUT ===> st F1=HELP F2=SPLIT F3=END F7=UP F8=DOWN F9=SWAP

SCROLL ===> PAGE F4=RETURN F5=IFIND F6=BOOK F10=LEFT F11=RIGHT F12=RETRIEVE

Figure 25: SDSF Primary Option Menu Enter ST (status) on the command line. Confirm your action by pressing Enter

Display Filter View Print Options Help ------------------------------------------------------------------------------SDSF STATUS DISPLAY ALL CLASSES LINE 1-9 (9) NP JOBNAME JOBID OWNER PRTY QUEUE C POS SAFF ASYS STATUS PRAKT20 TSU00826 PRAKT20 15 EXECUTION SYS1 SYS1 S PRAKT20P JOB00837 PRAKT20 1 PRINT A 1106 PRAKT20G JOB00838 PRAKT20 1 PRINT A 1107

COMMAND INPUT ===> F1=HELP F2=SPLIT F3=END F7=UP F8=DOWN F9=SWAP

SCROLL ===> PAGE F4=RETURN F5=IFIND F6=BOOK F10=LEFT F11=RIGHT F12=RETRIEVE

Figure 26: SDSF Status Display All Classes On the line of the job-number, we input a S (Select) and confirm with Enter. Now our script is displayed; we scroll to the results at the end:

25

tutor07.doc

Display Filter View Print Options Help ------------------------------------------------------------------------------SDSF OUTPUT DISPLAY PRAKT20P JOB00839 DSID 4 LINE 20 COLUMNS 02- 81 COMMAND INPUT ===> SCROLL ===> PAGE IEF374I STEP/PUTMSGS /STOP 2002093.1214 CPU 0MIN 00.15SEC SRB 0MIN 00.01S IEF375I JOB/PRAKT20P/START 2002093.1214 IEF376I JOB/PRAKT20P/STOP 2002093.1214 CPU 0MIN 00.15SEC SRB 0MIN 00.01S =========================================== PARAMETERS PASSED : QMGR - MQA1 QNAME - PRAKT20 NUMMSGS - 000000003 PADCHAR - Z MSGLENGTH - 000000005 PERSISTENCE - N =========================================== MQCONN SUCCESSFUL MQOPEN SUCCESSFUL 000000003 MESSAGES PUT TO QUEUE MQCLOSE SUCCESSFUL MQDISC SUCCESSFUL ******************************** BOTTOM OF DATA ******************************** F1=HELP F2=SPLIT F3=END F4=RETURN F5=IFIND F6=BOOK F7=UP F8=DOWN F9=SWAP F10=LEFT F11=RIGHT F12=RETRIEVE

Figure 27: SDSF Output Display Job von MQPUT Here we see what the script actually did, a MQCONN, MQOPEN, three messages created, MQCLOSE and MQDISC. We go back with F3 and observe the result of PRAKTxxG.
Display Filter View Print Options Help ------------------------------------------------------------------------------SDSF OUTPUT DISPLAY PRAKT20G JOB00838 DSID 4 LINE 24 COLUMNS 02- 81 COMMAND INPUT ===> SCROLL ===> PAGE IEF376I JOB/PRAKT20G/STOP 2002093.1204 CPU 0MIN 00.15SEC SRB 0MIN 00.01S =========================================== PARAMETERS PASSED : QMGR - MQA1 QNAME - PRAKT20 NUMMSGS - 000000003 GET - D SYNCPOINT - N =========================================== MQCONN SUCCESSFUL MQOPEN SUCCESSFUL 000000000 : 000000005 : ZZZZZ 000000001 : 000000005 : ZZZZZ 000000002 : 000000005 : ZZZZZ 000000003 MESSAGES GOT FROM QUEUE MQCLOSE SUCCESSFUL MQDISC SUCCESSFUL ******************************** BOTTOM OF DATA ******************************** F1=HELP F2=SPLIT F3=END F4=RETURN F5=IFIND F6=BOOK F7=UP F8=DOWN F9=SWAP F10=LEFT F11=RIGHT F12=RETRIEVE

Figure 28: SDSF Output Display Job of MQGET Here our 3 messages were retrieved again.

26

tutor07.doc

Exercise: Work on these tasks and send a print dump of the Screens 27 and 28 in bitmap or JPEG format (each figure must not exceed 250 Kbyte in size) to the Mail address of your teacher/tutor.

27

You might also like