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 » General Discussion » Java client sends message to COBOL server

Post new topic  Reply to topic
 Java client sends message to COBOL server « View previous topic :: View next topic » 
Author Message
sfari
PostPosted: Mon Mar 22, 2004 11:17 pm    Post subject: Java client sends message to COBOL server Reply with quote

Centurion

Joined: 15 Apr 2003
Posts: 144

We need to feed a COBOL transaction with data using a Java client. This input data is sent to the host using a MQ remote queue.

Thus means the message has to be converted into a structure like defined in the COBOL copybook at putting time.

Is there somebody doing something similar to this? Can somebody recommend a product for such a translation from COBOL to Java objects?

Thanks
Silvano
Back to top
View user's profile Send private message
kirani
PostPosted: Mon Mar 22, 2004 11:50 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Have you looked at WebSphere Business Integration Message Broker? It can take certain JMS message types (JMSMap, JMSStream) as input and convert them into COBOL copybook format.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Tue Mar 23, 2004 4:15 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Kirani is right that WBI Message Broker is an excellent product for this general class of problem.

It may, however, be a bit of overkill for this particular application.

Ask yourself how many Java applications you will have talking to how many COBOL applications. If it's just one and one, then you can just build the copybook formatted data yourself in the MQ Message using writeString and writeInt and etc. from the Java MQ APIs.

If it gets to be more than about five COBOL applications, you should start thinking about investing in WBI Message Broker - as you'll be able to then completely isolate your COBOL applications from your Java applications, and make significant changes (including replacing entire applications with new ones) without having to change the other side.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
clindsey
PostPosted: Tue Mar 23, 2004 6:42 am    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

Sfari,

If you decide to build a home grown app, here is a code snippet that will get you started on converting a copy book to java stream.
Code:

         //MQIIH-STRUCID        PIC X(4) VALUE 'IIH '.      ** Structure version number
         //MQIIH-VERSION        PIC S9(9) BINARY VALUE 1.   ** Length of MQIIH structure
         //MQIIH-STRUCLENGTH    PIC S9(9) BINARY VALUE 84.  ** Structure length
         //MQIIH-ENCODING       PIC S9(9) BINARY VALUE 0.   ** Reserved
         //MQIIH-CODEDCHARSETID PIC S9(9) BINARY VALUE 0.   ** Reserved
         //MQIIH-FORMAT         PIC X(8) VALUE SPACES.      ** MQ format name of data that follows MQIIH
         //MQIIH-FLAGS          PIC S9(9) BINARY VALUE 0.   ** Flags
         //MQIIH-LTERMOVERRIDE  PIC X(8) VALUE SPACES.      ** Logical terminal override
         //MQIIH-MFSMAPNAME     PIC X(8) VALUE SPACES.      ** Message format services map name
         //MQIIH-REPLYTOFORMAT  PIC X(8) VALUE SPACES.      ** MQ format name of reply message
         //MQIIH-AUTHENTICATOR  PIC X(8) VALUE SPACES.      ** RACF password or passticket
         //MQIIH-TRANINSTANCEID PIC X(16) VALUE LOW-VALUES. ** Transaction instance identifier
         //MQIIH-TRANSTATE      PIC X VALUE ' '.            ** Transaction state
         //MQIIH-COMMITMODE     PIC X VALUE '0'.            ** Commit mode
         //MQIIH-SECURITYSCOPE  PIC X VALUE 'C'.            ** Security scope
         //MQIIH-RESERVED       PIC X VALUE SPACES.         ** Reserved

         msg.writeString("IIH ");                         // MQIIH_STRUCT_ID
         msg.writeInt(1);                                 // MQIIH_VERSION_1
         msg.writeInt(84);                                // MQIIH_LENGTH_1
         msg.writeInt(0);                                 // 4 byte reserved 
         msg.writeInt(0);                                 // 4 byte reserved
         msg.writeString("MQIMSVS ");                     // MQFMT_IMS_VAR_STRING
         msg.writeInt(0);                                 // MQIIH_NONE
         msg.writeString("MASTER  ");                     // 8 byte ltermoverride
         msg.writeString("MODU03  ");                     // 8 byte mfsmapname
         msg.writeString("MQIMSVS ");                     // MQFMT_IMS_VAR_STRING
         msg.writeString("        ");                     // 8 byte authenticator
         msg.writeString("0000000000000000");             // 16 byte transid
         msg.writeString(" ");                            // MQITS_NOT_IN_CONVERSATION
         msg.writeString("0");                            // MQICM_COMMIT_THEN_SEND
         msg.writeString("C");                            // MQIIS_CHECK
         msg.writeString(" ");                            // 1 byte reserved


Charlie
Back to top
View user's profile Send private message
sfari
PostPosted: Tue Mar 23, 2004 8:18 am    Post subject: Reply with quote

Centurion

Joined: 15 Apr 2003
Posts: 144

Hi all, thanks for the replies!
Actually we currently only have two applications calling a host transaction over a message queue. But the input for them is quite a lot of data.

Since these cobol copybooks are even sometimes changing a home made implementation is not the way to go in my opinion.

But still I think that WBI Message Broker is a bit of an overkill.

I am rather looking for a tool, which generates Java beans out of COBOL copybook. This beans should then have something like a getBytes() method which returns a structure that's cobol compatible.

Does somebody know something like this?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Mar 23, 2004 8:54 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

WSAD will do this... If you can generate an XSD from a copybook.

Or you could try searching google for something that will perform data binding between Java objects and Cobol structures - like JAXB, but JACB.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sfari
PostPosted: Wed Mar 24, 2004 7:28 am    Post subject: Reply with quote

Centurion

Joined: 15 Apr 2003
Posts: 144

Until now we have been using CCF included in Visual Age for Java this cases.

I already had a look at the new product "WebSphere Application Developer Integration Edition". There are lots of connectors but no MQ connector.

And what also conserns me using this product is that everything is very tight to WS application server. Since we are not using this appl. server it makes not a lot of sense for us to use the product.

In case it is possible to generate such Java beans, which are not tight to EJBs we might consider using it anyway. Great would be a separate eclipse plugin or command line tool to do this!

Has somebody more experience in that.
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 » General Discussion » Java client sends message to COBOL server
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.