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 » invoke CICS transaction over MQ-CICS bridge

Post new topic  Reply to topic
 invoke CICS transaction over MQ-CICS bridge « View previous topic :: View next topic » 
Author Message
kraftix
PostPosted: Tue Aug 19, 2008 6:09 am    Post subject: invoke CICS transaction over MQ-CICS bridge Reply with quote

Newbie

Joined: 31 Mar 2008
Posts: 5

Hi,

I'm trying to invoke a CICS transaction over MQ-CICS bridge, but the message remain in the SYSTEM.CICS.BRIDGE. QUEUE and nothing happen on the CICS region.

Maybe somone can help me out and give me some advice what I'm doing wrong.

Here my MQ configuration (WMQ 5.3.1):

I defined the CICS bridge request queue as seen below:

Code:

                           Display a Local Queue - 1                           
                                                                               
 Press F8 to see further fields, or Enter to refresh details.                   
                                                                               
                                                                 More:    +     
 Queue name  . . . . . . . . . SYSTEM.CICS.BRIDGE.QUEUE                         
 Disposition . . . . . . . . : QMGR    CSQ1                                     
 Description . . . . . . . . : CICS BRIDGE REQUEST QUEUE                       
                                                                               
 Put enabled . . . . . . . . : Y  Y=Yes, N=No                                   
 Get enabled . . . . . . . . : Y  Y=Yes, N=No                                   
 Usage . . . . . . . . . . . : N  N=Normal, X=XmitQ                             
 Storage class . . . . . . . : DEFAULT                                         
 CF structure name . . . . . :                                                 
 Creation method . . . . . . : PREDEFINED                                       
                                                                               
 Page set identifier . . . . : 4                                               
 Use counts - Output . . . . : 0             Input . . . . : 1                 
 Current queue depth . . . . : 1                                               



Code:

                           Display a Local Queue - 4                           
                                                                               
 Press F7 or F8 to see other fields, or Enter to refresh details.             
                                                                               
                                                                 More:  - +   
 Queue name  . . . . . . . . : SYSTEM.CICS.BRIDGE.QUEUE                       
 Disposition . . . . . . . . : QMGR    CSQ1                                   
                                                                               
 Trigger Definition                                                           
                                                                               
    Trigger type . . . . . . : F  F=First, E=Every, D=Depth, N=None           
    Trigger set  . . . . . . : Y  Y=Yes, N=No                                 
                                                                               
    Trigger message priority : 0  0 - 9                                       
    Trigger depth  . . . . . : 1          1 - 999999999                       
                                                                               
    Initiation queue . . . . : CICS01.INITQ                                   
    Process name . . . . . . : CICS_BRIDGE                                     
    Trigger data . . . . . . :                                                 
                                                                               


with the process
Code:

                          Display a Process - 1                                 
                                                                               
 Press F8 to see further fields, or Enter to refresh details.                   
                                                                               
                                                                 More:    +     
 Process name  . . . . . . . . CICS_BRIDGE                                     
 Disposition . . . . . . . . : QMGR    CSQ1                                     
 Description . . . . . . . . : CICS BRIDGE MONITOR                             
                                                                               
 Application type  . . . . . : CICS                                             
                                                                               
 Application                                                                   
    ID . . . : CKBR                                                             
                                                                               


the defintions for the CKTI initiation queue:
Code:

                           Display a Local Queue - 1                           
                                                                               
 Press F8 to see further fields, or Enter to refresh details.                   
                                                                               
                                                                 More:    +     
 Queue name  . . . . . . . . . CICS01.INITQ                                     
 Disposition . . . . . . . . : QMGR    CSQ1                                     
 Description . . . . . . . . : CKTI initiation queue                           
                                                                               
 Put enabled . . . . . . . . : Y  Y=Yes, N=No                                   
 Get enabled . . . . . . . . : Y  Y=Yes, N=No                                   
 Usage . . . . . . . . . . . : N  N=Normal, X=XmitQ                             
 Storage class . . . . . . . : SYSVOLAT                                         
 CF structure name . . . . . :                                                 
 Creation method . . . . . . : PREDEFINED                                       
                                                                               
 Page set identifier . . . . :                                                 
 Use counts - Output . . . . : 0             Input . . . . : 1                 
 Current queue depth . . . . : 0                                               
                                                                               


Code:

                           Display a Local Queue - 4                           
                                                                               
 Press F7 or F8 to see other fields, or Enter to refresh details.               
                                                                               
                                                                 More:  - +     
 Queue name  . . . . . . . . : CICS01.INITQ                                     
 Disposition . . . . . . . . : QMGR    CSQ1                                     
                                                                               
 Trigger Definition                                                             
                                                                               
    Trigger type . . . . . . : F  F=First, E=Every, D=Depth, N=None             
    Trigger set  . . . . . . : N  Y=Yes, N=No                                   
                                                                               
    Trigger message priority : 0  0 - 9                                         
    Trigger depth  . . . . . : 1          1 - 999999999                         
                                                                               
    Initiation queue . . . . :                                                 
    Process name . . . . . . :                                                 
    Trigger data . . . . . . :                                                 
                                                                               


Then I start the CICS adapter with the CKTI trigger monitor with the CKBM transaction:
Code:

 CKQCM2                     Display Connection panel                           
                                                                               
 Read connection information. Then press F12 to cancel.                         
                                                                               
   CICS Applid =  CICS      Connection Status = Connected       QMgr name= CSQ1
   Trace Num   =  001       Tracing           = On              API Exit = Off 
   Initiation Queue Name = CICS01.INITQ                                         
 --------------------------------- STATISTICS ---------------------------------
 Number of in-flight tasks =   2           Total API calls        =        635 
 Number of running CKTI    =   1                                               
          APIs and flows analysis               Syncpoint          Recovery     
 ----------------------------------------  -------------------  ---------------
 Run OK            7  MQINQ             3  Tasks             1  Indoubt       0
 Futile            0  MQSET             0  Backout           0  UnResol       0
 MQOPEN            4  ------ Flows ------  Commit            0  Commit        0
 MQCLOSE           0  Calls           637   S-Phase          0  Backout       0
 MQGET           628  SyncComp          9   2-Phase          0                 
  GETWAIT        628  SuspReqd          0  ------------- Task Use -------------
 MQPUT             0  Msg Wait        628  Initial   8 Started   8 Busy      0 
 MQPUT1            0  Switched        636                                       
                                                                               
                                                                               


Code:

 CKQCM4                       Display CKTI panel                               
                                                                               
 Read CKTI status information. Then press F12 to cancel.                       
                                                                               
 CKTI   1 to   1 of   1                                                         
                                                                               
  Task Num    Task Status    Thread Status   Num of APIs    Last API           
 ----------  -------------  ---------------  ------------  ----------           
  0000109       Normal         Msg Wait                2     MQGET             
    Initiation Queue Name: CICS01.INITQ                                         
                                                                               


Code:

 CKQCM3                       Display Task panel                               
                                                                               
 Read task status information. Then press F12 to cancel.                       
                                                                               
 Tasks   1 to   2 of   2                                                       
                                                                               
 Tran   User   Task    Task    Thread     Total    Res  API    Last     Thread 
 Id      Id     Num   Status   Status      APIs    Sec  Exit  MQ call     ID   
 ---- -------- ----- -------- --------  ---------- ---  --- ---------- --------
 CKTI CICSUSER 00109  Normal  Msg Wait           2 No   No    MQGET    124BE2E0
 CKBR CICSUSER 00126  Normal  Msg Wait         643 No   No    MQGET    124BE1C8
                                                                               


After CICS adapter is connected to CICS01.INITQ I start the MQ-CICS bridge at calling the CKBR transaction with following parameter:
Code:

CKBR Q=SYSTEM.CICS.BRIDGE.QUEUE, AUTH=LOCAL, WAIT = 30


This CICS terminal freezed and not longer usable. In the CICS log I can see that the bridge was started successfully:
Code:
IBM WebSphere MQ for z/OS V5.3.1 - CICS bridge. Copyright(c) 1997,2000 IBM. All rights reserved
Monitor initialization complete                         
Auth=LOCAL, WaitInterval=30000, Q=SYSTEM.CICS.BRIDGE.QUEUE


I suppose something is wrong with my configuration. I have a small java application implementing the MQCIH header to put the message on the queue. But even if the message format is not OK, from my point of view I should see something in the CICS log. Am I right?

If someone can provide me with an approach to determining what is wrong I would appreciate it.

Thank you very much
kraftix
Back to top
View user's profile Send private message
bob_buxton
PostPosted: Tue Aug 19, 2008 1:38 pm    Post subject: Reply with quote

Master

Joined: 23 Aug 2001
Posts: 266
Location: England

Since you have set up triggering you should not need to start CKBR manually, it should start automatically when a message arrives.
With MQ v6 it won't lock your terminal if you do start it manually.

The most likely cause for it not processing your messages is that you didn't put the special MQCI_NEW_SESSION value into the correlid field of the MQMD. CKBR ignores messages that don't have that correlation id.
_________________
Bob Buxton
Ex-Websphere MQ Development
Back to top
View user's profile Send private message
kraftix
PostPosted: Wed Aug 20, 2008 8:45 am    Post subject: Reply with quote

Newbie

Joined: 31 Mar 2008
Posts: 5

Thank you very much Bob for the quick response, you've been right with the with the special value MQCI_NEW_SESSION in the message descriptor. Now it seems that the MQMD and MQCIH message is beeing processed.

But something is still wrong with my message format, because I get the following information on the cosole and the CPU usage is low, CICS is doing nothing.
Code:
+DFHSM0133 CICS CICS is under stress (short on storage above 16MB).

Calling this transaction over a CICS terminal everything works fine.

I've below my java application with the message format, maybe somebody can look through and let me know which parameter are need to be set.

I don't find a really good example on the internet for java coding the MQMD and the MQCIH.

Code:

import com.ibm.mq.*;

public class MQPutCICS
{
 
  private String qManager = "qmanagername";
  private String qName = "qname";

 
  private MQQueueManager qMgr; 

  public static void main(String args[]){           
     new MQPutCICS();
  }

  public MQPutCICS() {
   try {
      // Create a connection to the queue manager
      qMgr = new MQQueueManager(qManager);
     
   int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_INQUIRE ;
     
      // specify the queue
      MQQueue queue = qMgr.accessQueue(qName, openOptions, null, null, null);         

     
      try
      {
        MQMessage  putMsg = new MQMessage();

        //set MQMD (message descriptor)
       
        putMsg.correlationId=MQC.MQCI_NEW_SESSION;
        putMsg.format=MQC.MQFMT_CICS;
       
        putMsg.encoding=MQC.MQENC_INTEGER_NORMAL;    //Big-Endian integers, as in Java
        putMsg.characterSet=819;                     //Internal logic defaults this to 819,
                                 

        //write MQCIH into message buffer
        //as constants are not predefined in MQC, need to define or simply write in defaults

        putMsg.writeString("CIH ");           //MQCHAR4  StrucId;             /* Structure identifier */
        putMsg.writeInt(2);                   //MQLONG   Version;             /* Structure version number 1 or 2 */
        putMsg.writeInt(180);                 //MQLONG   StrucLength;         /* Length of MQCIH structure V1=164 V2=180 */
        putMsg.writeInt(putMsg.encoding);     //MQLONG   Encoding;            /* Reserved */
        putMsg.writeInt(putMsg.characterSet); //MQLONG   CodedCharSetId;      /* Reserved */
        putMsg.writeString(MQC.MQFMT_CICS);   //MQCHAR8  Format;              /* MQ Format name */
        putMsg.writeInt(0);                   //MQLONG   Flags;               /* Reserved */
        putMsg.writeInt(0);                   //MQLONG   ReturnCode;          /* Return code from bridge */         
        putMsg.writeInt(0);                   //MQLONG   CompCode;            /* MQ completion code or CICS EIBRESP */                         
        putMsg.writeInt(0);                   //MQLONG   Reason;              /* MQ reason or feedback code, or CICS EIBRESP2 */                         
        putMsg.writeInt(273);                 //MQLONG   UOWControl;          /* Unit-of-work control */             
        putMsg.writeInt(-2);                  //MQLONG   GetWaitInterval;     /* Wait interval for MQGET call issued by bridge */                       
        putMsg.writeInt(1);                   //MQLONG   LinkType;            /* Link type */                       
        putMsg.writeInt(-1);                  //MQLONG   OutputDataLength;    /* Output commarea data length */     
        putMsg.writeInt(0);                   //MQLONG   FacilityKeepTime;    /* Bridge facility release time */     
        putMsg.writeInt(0);                   //MQLONG   ADSDescriptor;       /* Send/receive ADS descriptor */     
        putMsg.writeInt(0);                   //MQLONG   ConversationalTask;  /* Whether task can be conversational */                   
        putMsg.writeInt(0);                   //MQLONG   TaskEndStatus;       /* Status at end of task */           
        byte [] temp = new byte[8];           //initialise as required
        putMsg.write(temp);             //MQBYTE   Facility[8];         /* BVT token value */
        putMsg.writeString("T046");           //MQCHAR4  Function;            /* MQ call name or CICS EIBFN function name */                             
        putMsg.writeString("    ");           //MQCHAR4  AbendCode;           /* Abend code */                       
        putMsg.writeString("        ");       //MQCHAR8  Authenticator;       /* Password or passticket */           
        putMsg.writeString("        ");       //MQCHAR8  Reserved1;           /* Reserved */                         
        putMsg.writeString(MQC.MQFMT_CICS);   //MQCHAR8  ReplyToFormat;       /* MQ format name of reply message */ 
        putMsg.writeString("    ");           //MQCHAR4  RemoteSysId;         /* Remote sysid to use */             
        putMsg.writeString("    ");           //MQCHAR4  RemoteTransId;       /* Remote transid to attach */         
        putMsg.writeString("T046");           //MQCHAR4  TransactionId;       /* Transaction to attach */           
        putMsg.writeString("    ");           //MQCHAR4  FacilityLike;        /* Terminal emulated attributes */     
        putMsg.writeString("    ");           //MQCHAR4  AttentionId;         /* AID key */                         
        putMsg.writeString("    ");           //MQCHAR4  StartCode;           /* Transaction start code */           
        putMsg.writeString("    ");           //MQCHAR4  CancelCode;          /* Abend transaction code */           
        putMsg.writeString("    ");           //MQCHAR4  NextTransactionId;   /* Next transaction to attach */       
        putMsg.writeString("        ");       //MQCHAR8  Reserved2;           /* Reserved */                         
        putMsg.writeString("        ");       //MQCHAR8  Reserved3;           /* Reserved */                         
       
        //Version 2 fields
        putMsg.writeInt(0);                   //MQLONG   CursorPosition;      /* Cursor position */
        putMsg.writeInt(0);                   //MQLONG   ErrorOffset;         /* Error offset */
        putMsg.writeInt(0);                   //MQLONG   InputItem;           /* Input item */
        putMsg.writeInt(0);                   //MQLONG   Reserved4;           /* Reserved */
               
        //put message to queue
        MQPutMessageOptions pmo = new MQPutMessageOptions();
        pmo = new MQPutMessageOptions();
        queue.put(putMsg, pmo);   

      }
      catch(MQException ex)
      {
        System.err.println("MQPUT failed with error code: " + ex.reasonCode);
      }
     
      queue.close();
      qMgr.disconnect();
      }
      catch (Exception ex){
      System.out.println("An error occurred writing to the message buffer: " + ex);
      }
  }
}



Thank you very much.
Back to top
View user's profile Send private message
kraftix
PostPosted: Thu Aug 21, 2008 1:16 am    Post subject: Reply with quote

Newbie

Joined: 31 Mar 2008
Posts: 5

Hi,

even trying to start the transaction CEMT or CEDA over the queue, CICS print the message
Code:
CICS is under stress (short on storage above 16MB)
on the console and nothing happen. CPU usage is almost zero.
After this I've to kill the CICS region, because I can't no longer submit any commands the terminal.

Do I need to specify some more values on the MQMD | MQCIH message?

Somebody here who run into the same issue? I would appreciate every helpful advice on this issue.

Thankyou very much,
kraftix
Back to top
View user's profile Send private message
bob_buxton
PostPosted: Thu Aug 21, 2008 12:36 pm    Post subject: Reply with quote

Master

Joined: 23 Aug 2001
Posts: 266
Location: England

There are a number of potential problems with your messages, though I wouldn't expect them to cause CICS to go short on storage.

Firstly are you trying to run a transaction or link to a program?

You have mentioned transaction such as CEMT but you have specified LinkType 1 which is MQCLT_PROGRAM, rather than MQCLT_TRANSACTION which is 2.

I don't see any data following the CIH header;
For a program link you need the 8-byte program name followed by the data to be passed to the program in the Commarea. You don't need to specify a transaction name, if you do it must invoke program CSQCBP00.

For a transaction you would normally specify the transaction input data in a set of ADS vectors - these can quite complex to build and interpret the output.

Speaking of output I don't see where you have specified your reply queue.

The format fields in the MQCIH should not be MQFMT_CICS - they should describe the format following the CIH, for transactions the input format is
'CSQCBDCI'

There is a chapter on using the CICS bridge in the MQ application programming guide.
_________________
Bob Buxton
Ex-Websphere MQ Development
Back to top
View user's profile Send private message
kraftix
PostPosted: Fri Aug 22, 2008 6:41 am    Post subject: Reply with quote

Newbie

Joined: 31 Mar 2008
Posts: 5

Thank you very much Bob for the helpfully response.

I specified the values you told me on MQMD and MQCIH as shown below:

Code:

putMsg.replyToQueueName="name of the replyqueue";
putMsg.messageId=MQC.MQMI_NONE;   
putMsg.correlationId=MQC.MQCI_NEW_SESSION;

putMsg.writeString("CSQCBDCI");        //Format;
putMsg.writeInt(2);                 //LinkType; 
putMsg.writeInt(0);                              //ConversationalTask;
putMsg.writeString("S   ");                   //StartCode; 


and of course my transactionid I want to attach.
And herefor I need your support again, if possible and if you would be so kind?

The transaction don't need any input data but it is a long running transaction, about a half a minute. Do I need to define some values for the long running time?

It is written in C with only one EXEC CICS SEND MAP to let the user know that the transaction terminated on a 3270 terminal.

Code:

....
C-Code
....
EXEC CICS SEND MAP("map123") MAPSET("mset123") ERASE;


Code:

MSET123 DFHMSD TYPE=MAP,MODE=INOUT,LANG=C,STORAGE=AUTO,TIOAPFX=YES     
*       MENU MAP.                                                       
MAP123  DFHMDI SIZE=(24,80),CTRL=(PRINT,FREEKB)                         
        DFHMDF POS=(12,33),ATTRB=(ASKIP,NORM),LENGTH=15,               X
               INITIAL='TRANSACTION RUN'                               
        DFHMSD TYPE=FINAL                                               
        END                                                             
/*       
//                         


To transmit the output statement to the reply queue I need something like a BRMQ structure after MQCIH, as I read in the MQ application programming guide. Can you provide me with some information how I must define my data fields (BRMQ structure) for the transaction above?

Sorry, but I can find any documentation or an example for java.

Thank you very much!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » invoke CICS transaction over MQ-CICS bridge
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.