Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need a sample JCL which does MQ processing

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
View previous topic :: :: View next topic  
Author Message
nirmal_path

New User


Joined: 08 Jan 2007
Posts: 1
Location: Pune, India

PostPosted: Tue Jan 09, 2007 1:09 pm    Post subject: Need a sample JCL which does MQ processing
Reply with quote

Hi,

I am in need of a sample JCL which does MQ processing as well as sample Cobol code which does things like MQPUT/GET/CONN etc. New to MQ and hence the need.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Jan 09, 2007 5:43 pm    Post subject:
Reply with quote

Do what I usually do, get the manual and copy some sample programs.
I found these in a sample lib; CSQ4BVJ1, CSQ4BVK1 and CSQ4BVK2 to get and put and browse with needed jcl documentation in the manuals.
Back to top
View user's profile Send private message
Kayalvizhi Sankaralingam

New User


Joined: 08 Dec 2006
Posts: 1
Location: Chennai

PostPosted: Wed Jan 10, 2007 11:34 pm    Post subject:
Reply with quote

Hi,
I don't know about COBOL. But I have in PL/1. Please see, whether it is useful.


SUB-Program which has PUT call.
Procedure to PUT message,

VERARB_SENDMQ: PROCEDURE REORDER ;

DCL LOCAL_MQMD LIKE MQMD;
DCL LOCAL_MQPMO LIKE MQPMO;

DCL BUFFER CHAR(6000) BASED(SENDMQE.MSGPTR);
DCL BUFFER_VAR CHAR(6000) VARYING;
DCL BUFFER_TEMP CHAR(SENDMQE.LENGTH);

BUFFER_VAR = SUBSTR(BUFFER,1,SENDMQE.LENGTH);
BUFFER_TEMP = BUFFER_VAR;

IF SENDMQE.FORMAT = 'STRING'
THEN DO;
LOCAL_MQMD.FORMAT = MQFMT_STRING;
END;
LOCAL_MQMD.MSGTYPE = MQMT_DATAGRAM;
LOCAL_MQMD.PRIORITY = 1;
LOCAL_MQMD.PERSISTENCE = MQPER_PERSISTENCE_AS_Q_DEF;
LOCAL_MQMD.REPLYTOQ = SENDMQE.REPLYQNAME;
LOCAL_MQMD.REPLYTOQMGR = SENDMQE.REPLYQMGR;
LOCAL_MQMD.MSGID = MQMI_NONE;
LOCAL_MQMD.CORRELID = MQCI_NONE;
LOCAL_MQPMO.OPTIONS = SENDMQE.PUT_OPTIONS;

CALL MQPUT (SENDMQE.HCONN,
SENDMQE.HOBJ,
LOCAL_MQMD,
LOCAL_MQPMO,
SENDMQE.LENGTH,
BUFFER_TEMP,
SENDMQA.COMPCODE,
SENDMQA.REASON);

IF SENDMQA.COMPCODE ^= MQCC_OK
! SENDMQA.REASON ^= MQRC_NONE
THEN DO;
SENDMQO.RC = 8;
SENDMQA.SEND_FAILED = 1;
PUT SKIP LIST('***MQ PUT ERROR***');
PUT SKIP LIST('***CONNECTION HANDLE :'!!SENDMQE.HCONN
!!'***');
PUT SKIP LIST('***QUEUE HANDLE :'!!SENDMQE.HOBJ
!!'***');
PUT SKIP LIST('***MQ COMPCODE ',SENDMQA.COMPCODE,'***');
PUT SKIP LIST('***MQ REASON ',SENDMQA.REASON,'***');
RETURN;
END; /* IF COMPCODE ^= MQCC_OK */

SENDMQA.MSG_ID = LOCAL_MQMD.MSGID;

Input Structure of Sub-Program:
DCL 1 SENDMQE,
5 MSGPTR POINTER,
5 PUT_OPTIONS BIN FIXED(31,0),
5 HCONN BIN FIXED(31,0),
5 LENGTH BIN FIXED(31,0),
5 HOBJ BIN FIXED(31,0),
5 REPLYQMGR CHAR (48),
5 REPLYQNAME CHAR (48),
5 FORMAT CHAR (10);


Main Program to call the above sub-program:

SENDMQE.MSGPTR = ADDR(TAXSEND_MSG); /* actual message to be sent */
SENDMQE.PUT_OPTIONS = PUTOPTIONS; /* get from JCL */
SENDMQE.HCONN = OPENMQA.HCONN;
SENDMQE.HOBJ = OPENMQA.HOBJ;
SENDMQE.LENGTH = 176;
SENDMQO.METHOD = 'SEND';
SENDMQO.MCB_P = ADDR(MCB);
SENDMQE.FORMAT = 'STRING';
SENDMQE.REPLYQMGR = REPLY_QMGR; /* get from JCL */
SENDMQE.REPLYQNAME = REPLY_QUEUE; /* get from JCL */

CALL SENDMQ (SENDMQP);

Compile JCL - should have the MQ library for loadmodules of MQPUT etc.,:

//LINK.CSQSTUB DD DSN=MQ2T.SCSQLOAD,DISP=SHR
//LINK.SYSIN DD *
INCLUDE CSQSTUB(CSQQSTUB)
/*


RUN - JCL with the following:

Parameters for the program:
//QMGR DD *
MQ2T
/*
//RPLQMGR DD *
MQ2T
/*
//RPLQ DD *
TEST.DE.Q01
/*
//QNAME DD *
TEST.DE.Q01
/*
//PARAM DD *
*000016*0000002
/*

we need to add these libraries(MQ specific and IMS related) in JCL:

//STEPLIB DD DSN=MQ2T.USERAUTH,DISP=SHR
// DD DSN=MQ2T.USERLOAD,DISP=SHR
// DD DSN=MQ2T.SCSQANLE,DISP=SHR
// DD DSN=MQ2T.SCSQAUTH,DISP=SHR
// DD DSN=IMSTST.IMF.RESLIB,DISP=SHR
// DD DSN=IMSTST.RESLIB,DISP=SHR
// DD DSN=DB2TST.SDSNLOAD,DISP=SHR
// DD DSN=EORGA.TEST.LOADLIB,DISP=SHR
// DD DSN=IMSTST.DOPPSB,DISP=SHR
//DFSESL DD DSN=DB2TST.SDSNLOAD,DISP=SHR
// DD DSN=MQ2T.SCSQAUTH,DISP=SHR
// DD DSN=MQ2T.SCSQANLE,DISP=SHR
// DD DSN=IMSTST.RESLIB,DISP=SHR
//IMS DD DSN=IMSTST.DOPPSB,DISP=SHR
// DD DSN=IMSTST.DBDLIB,DISP=SHR
//CSQSNAP DD SYSOUT=*



Hope it is useful.

Regards,
Kayal
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Thu Jan 25, 2007 1:25 pm    Post subject:
Reply with quote

If you go thru IBM MQ Series Manual , it has code in various programming languages to handle all the MQ API Calls.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Asynchronous CICS Processing Question moezbud CICS 1 Mon Mar 06, 2017 6:13 pm
No new posts Run stats processing on zIIP Engine Virendra Shambharkar DB2 9 Fri Oct 14, 2016 10:24 am
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us