Author |
Message
|
cicsprog |
Posted: Mon Jun 25, 2012 1:20 pm Post subject: |
|
|
Partisan
Joined: 27 Jan 2002 Posts: 347
|
Here's a code snipped and some JCL sample. Simple COBOL program up to the MQOPEN. Parms are passed via JCL parm statment.
Code: |
WORKING-STORAGE SECTION.
01 W00-RETURN-CODE PIC S9(4) BINARY VALUE ZERO.
01 W00-QMGR PIC X(48).
01 W00-QNAME PIC X(48).
01 W03-HCONN PIC S9(9) BINARY VALUE 0.
01 W03-HOBJ PIC S9(9) BINARY VALUE 0.
01 W03-OPENOPTIONS PIC S9(9) BINARY.
01 W03-COMPCODE PIC S9(9) BINARY.
01 W03-REASON PIC S9(9) BINARY.
01 MQM-OBJECT-DESCRIPTOR.
COPY CMQODV.
01 MQM-MESSAGE-DESCRIPTOR.
COPY CMQMDV.
01 MQM-PUT-MESSAGE-OPTIONS.
COPY CMQPMOV.
01 MQM-CONSTANTS.
COPY CMQV.
LINKAGE SECTION.
01 PARMDATA.
05 PARM-LEN PIC S9(03) BINARY.
05 PARM-STRING PIC A(100).
PROCEDURE DIVISION USING PARMDATA.
A-MAIN SECTION.
IF PARM-LEN = 0 THEN
MOVE 8 TO RETURN-CODE
GO TO A-MAIN-END
END-IF.
UNSTRING PARM-STRING DELIMITED BY ALL ','
INTO W00-QMGR
W00-QNAME.
DISPLAY '==========================================='.
DISPLAY 'PARAMETERS PASSED :'.
DISPLAY ' QMGR - ', W00-QMGR.
DISPLAY ' QNAME - ', W00-QNAME.
DISPLAY '==========================================='.
CALL 'MQCONN' USING W00-QMGR
W03-HCONN
W03-COMPCODE
W03-REASON.
IF (W03-COMPCODE NOT = MQCC-OK) THEN
MOVE 'MQCONN' TO W00-ERROR-MESSAGE
MOVE W03-REASON TO W00-RETURN-CODE
DISPLAY 'Error=' W00-ERROR-MESSAGE
DISPLAY 'RC=' W00-RETURN-CODE
GO TO A-MAIN-END
END-IF.
DISPLAY 'MQCONN SUCCESSFUL'.
...
...
...
A-MAIN-END
GOBACK.
//MYPGM EXEC PGM=MYMQPGM,REGION=0M,
// PARM='mqmn,SYSTEM.DEFAULT.LOCAL.QUEUE'
//STEPLIB DD DISP=SHR,DSN=MYMQPGM.LOADLIB
// DD DISP=SHR,DSN=XXXXXXXX.SCSQAUTH
// DD DISP=SHR,DSN=XXXXXXXX.SCSQLOAD
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=* |
|
|
Back to top |
|
 |
cicsprog |
Posted: Wed Jun 27, 2012 9:02 am Post subject: |
|
|
Partisan
Joined: 27 Jan 2002 Posts: 347
|
So what did you find out? Dioes it work now? What was the resolution? |
|
Back to top |
|
 |
rss0213 |
Posted: Tue Aug 07, 2012 4:51 am Post subject: |
|
|
Novice
Joined: 17 May 2007 Posts: 15
|
Sorry, I've been busy with other stuff and haven't had time to post an update. I see several questions here I need to respond to - try to get to that later today. _________________ Thanks!
Scott |
|
Back to top |
|
 |
mahesh_klm |
Posted: Tue Dec 04, 2012 6:45 pm Post subject: |
|
|
Novice
Joined: 21 Jun 2012 Posts: 13 Location: India/Bangalore
|
One more guy facing the issue of 2058 while inserting message to MQ via batch job. From the above posts it seems like i need to add one more library in step lib, and check the compiler option. Will try them today.My actual requirement is to call MQPUT1 and insert message to Q. MQPUT1 abended with 2018(invalid connection handler).So tried to get connection handler via MQCONN and call MQPUT1. Please let me know if my approach is correct or not |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Dec 04, 2012 7:29 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
mahesh_klm wrote: |
MQPUT1 abended with 2018(invalid connection handler).So tried to get connection handler via MQCONN and call MQPUT1. Please let me know if my approach is correct or not |
Connection handler? No.
What ReasonCode did your app get from the MQCONN? If the MQCONN failed, then all subsequent calls will fail with 2018 Invalid connection handle.
It is possible that the MQCONN was successful, and a connection handle was returned, but you are not using it on the MQPUT1.
Please look at the supplied sample programs source code. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Dec 04, 2012 8:35 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
and remember in zOS online and batch link to different libraries...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mahesh_klm |
Posted: Wed Dec 05, 2012 3:21 am Post subject: |
|
|
Novice
Joined: 21 Jun 2012 Posts: 13 Location: India/Bangalore
|
Thanks bruce2359 and fjb_saper.
I am getting return code 2 and reason code as 2058. Is there any other value i need to look for.
This is a batch cobol application and it is getting failed in MQCONN step.
From the posts above, there should be some MQ libraries. Is there any chance that the program returns 2058 die to the libraries not found. |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Dec 05, 2012 5:23 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
The WMQ Application Programming Reference, and WMQ Application Programming Guide (or their InfoCenter equivalents) will provide you with compile and linkedit instructions.
Do a quick search of Google for 'wmq+compile+cobol+z/os'. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Dec 05, 2012 5:25 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
2058 is usually caused by a spelling or UPPERlowerCASE error in the qmgr name, not in a compile issue. |
|
Back to top |
|
 |
Mr Butcher |
Posted: Wed Dec 05, 2012 5:28 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
or of the job running in the wrong LPAR _________________ Regards, Butcher |
|
Back to top |
|
 |
mahesh_klm |
Posted: Thu Dec 27, 2012 5:55 pm Post subject: |
|
|
Novice
Joined: 21 Jun 2012 Posts: 13 Location: India/Bangalore
|
The issue was solved. It was due to wrong definition of Queues. |
|
Back to top |
|
 |
Mr Butcher |
Posted: Thu Dec 27, 2012 11:02 pm Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
Could you please be a bit more specific about what was wrong with the queue? As (IMHO) a returncode of 2058 (queue manager name error) is not related to a wrong queue definition. _________________ Regards, Butcher |
|
Back to top |
|
 |
|