ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » 2058 error on MQCONN in OS390 Batch

Post new topic  Reply to topic Goto page Previous  1, 2, 3
 2058 error on MQCONN in OS390 Batch « View previous topic :: View next topic » 
Author Message
cicsprog
PostPosted: Mon Jun 25, 2012 1:20 pm    Post subject: Reply with quote

Partisan

Joined: 27 Jan 2002
Posts: 314

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
View user's profile Send private message
cicsprog
PostPosted: Wed Jun 27, 2012 9:02 am    Post subject: Reply with quote

Partisan

Joined: 27 Jan 2002
Posts: 314

So what did you find out? Dioes it work now? What was the resolution?
Back to top
View user's profile Send private message
rss0213
PostPosted: Tue Aug 07, 2012 4:51 am    Post subject: Reply with quote

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
View user's profile Send private message
mahesh_klm
PostPosted: Tue Dec 04, 2012 6:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Tue Dec 04, 2012 7:29 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9405
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
View user's profile Send private message
fjb_saper
PostPosted: Tue Dec 04, 2012 8:35 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20697
Location: LI,NY

and remember in zOS online and batch link to different libraries...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mahesh_klm
PostPosted: Wed Dec 05, 2012 3:21 am    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Wed Dec 05, 2012 5:23 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9405
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
View user's profile Send private message
mqjeff
PostPosted: Wed Dec 05, 2012 5:25 am    Post subject: Reply with quote

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
View user's profile Send private message
Mr Butcher
PostPosted: Wed Dec 05, 2012 5:28 am    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

or of the job running in the wrong LPAR
_________________
Regards, Butcher
Back to top
View user's profile Send private message
mahesh_klm
PostPosted: Thu Dec 27, 2012 5:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mr Butcher
PostPosted: Thu Dec 27, 2012 11:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3 Page 3 of 3

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » 2058 error on MQCONN in OS390 Batch
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.