BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
havmaage
Obsidian | Level 7

Hi, 

I am trying to connect to an MQ from as sas data step program. 

I have found this example code 

 

 data _null_;
   length hconn hobj cc reason 8;
   length rc hod hpmo hmd hmap hdata 8;
   length parms $ 200 options $ 200 action $ 3 msg $ 200;

   hconn=0;
   hobj=0;
   hod=0;
   hpmo=0;
   hmd=0;
   hmap=0;
   hdata=0;
   cc=0;	

   put '---------------- Connect to QMgr --------------';
   qmgr="MQS1";
   call mqconn(qmgr, hconn, cc, reason);
   if cc ^= 0 then do;
      if reason = 2002 then do;
         put 'Already connected to QMgr ' qmgr;
      end;
   else do;
      if reason = 2059 then
         put 'MQCONN: QMgr not available... 
		    needs to be started';
      else
         put 'MQCONN: failed with reason= ' reason;
      goto exit;
      end;
   end;
   else put 'MQCONN: successfully connected to QMgr ' qmgr;

exit: 

run;

I am running this code in SAS 9.2 from SAS-EG 4.3 connected to a metadata server just to very that i can connect to our MQ  

 

I am wondering how i should specify hostname, port to the remote Queue just to very the connection. Do i need to have some

module installed to dfo this. ? 

This code returns -1 in reason. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

1.The software needed for CORBA/MSMQ/MQSeries communications is SAS Integration Technologies.

Since you use EG, your server has this component licenced.

 

2. Did you read these pages? 

WebSphere MQ CALL Routines

Usage Note 15291: MQCONN: failed with reason= -1 when using the SAS Interface to WebSphere MQ

View solution in original post

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

1.The software needed for CORBA/MSMQ/MQSeries communications is SAS Integration Technologies.

Since you use EG, your server has this component licenced.

 

2. Did you read these pages? 

WebSphere MQ CALL Routines

Usage Note 15291: MQCONN: failed with reason= -1 when using the SAS Interface to WebSphere MQ

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 547 views
  • 1 like
  • 2 in conversation