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 » WebSphere Message Broker (ACE) Support » Sequence of record is not fixed

Post new topic  Reply to topic
 Sequence of record is not fixed « View previous topic :: View next topic » 
Author Message
narki
PostPosted: Sun Jun 25, 2006 6:13 pm    Post subject: Sequence of record is not fixed Reply with quote

Acolyte

Joined: 19 Dec 2005
Posts: 67

I have a design issue,
I need to transform CobolCopy book to an XML. The cobol copy book whivh I will be getting will be a set of records
like R1......R2......T1......P1........... Each record is of 3500 bytes. First two character will represent record type.
These record can occurs in any order and lenght of the message will vary. Ths cobol copybook need to be tansaformed into XML filed by field basis.
Similarly I need to transform XML to cobol copy book.

One solution come to my mind is as follows
1. creat a message for each record in message set.
2. Create a function for each record type
3. In the function pass this record and Outputroot . Use the CREATE statement with the DOMAIN and PARSE clauses to record.
4. Finally use set statement for set outgoung XML messages.

I have to write alsmost 35 function for this as I will be geting n35 diffrent kind of records. Similrly I have to write 35 diffent function for converting XML to copybook

I would like to know is there any better solution to this us present. Please share you knowledge for this problem.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Sun Jun 25, 2006 8:14 pm    Post subject: Re: Sequence of record is not fixed Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi narki,
narki wrote:
These record can occurs in any order and lenght of the message will vary. Ths cobol copybook need to be tansaformed into XML filed by field basis.
Similarly I need to transform XML to cobol copy book.

One solution come to my mind is as follows
1. creat a message for each record in message set.
2. Create a function for each record type
3. In the function pass this record and Outputroot . Use the CREATE statement with the DOMAIN and PARSE clauses to record.
4. Finally use set statement for set outgoung XML messages.

I have to write alsmost 35 function for this as I will be geting n35 diffrent kind of records. Similrly I have to write 35 diffent function for converting XML to copybook

If the order of your records is random, how are u going to create a message set ?

How about this....not sure it will work with copybooks.
Create a message with one complex tag,say Root. This will have -1 max occurances....define all the other records as complex types within this Root, with min occurance of 0 and max 1...

I think it should fetch all the segments and create your message without any ESQL.

Regards.
Back to top
View user's profile Send private message Send e-mail
shalabh1976
PostPosted: Sun Jun 25, 2006 11:05 pm    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

How about using Type Composition as Unordered Set ?
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
kimbert
PostPosted: Tue Jun 27, 2006 12:55 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Hi Narki,

If your messages only contain character data, you could use the MRM TDS format ( your message is a repeating sequence of tagged records, and MRM TDS is good at handling tagged data ).

However, I'm assuming that with 3500 bytes in each record, there are probably some CWF-specific types ( e.g. packed decimal, integer ). If so, your approach is on the right lines, but I reckon you could make it a lot simpler. Instead of creating one function per record type, why not use a single function which takes the message name as a parameter? Otherwise you will be creating and maintaining 35 almost-identical functions. If you name each message using its two-character identifier you can extract the message name from the bitstream automatically.

Similar comments apply to the XML -> copybook scenario.
Back to top
View user's profile Send private message
narki
PostPosted: Tue Jun 27, 2006 5:45 pm    Post subject: Reply with quote

Acolyte

Joined: 19 Dec 2005
Posts: 67

Hi kimbert,

Yes I am also little bit uncomfortable with 35 functions, but I need to map CWF filed to XMl field, which are diffrent name. Like in cwf it is FOO_ONE and equivalent XML name is FooOne. I am looking some solution at message set and message level.

Thanks
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jun 28, 2006 2:10 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

The MRM XML format allows you to use an XML name which is different from the name in the tree (see 'XML Name' property on elements and attributes). You could use this facility to avoid the mapping of names in ESQL. Then your 35 functions could be collapsed into one.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Jun 28, 2006 2:28 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Also, the v6 Mapping tool can handle (i.e., automatically map for you) some kinds of name differences - like it might be able to tell that FOO_ONE should go to FooOne.

But you'd need to build 35 different maps - I think.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
narki
PostPosted: Wed Jun 28, 2006 7:29 pm    Post subject: Reply with quote

Acolyte

Joined: 19 Dec 2005
Posts: 67

Kimbert,
There are some fields which are not required in XML like FILLERS. Also Cobol Copy book a lot and huge. I am just worrird if I use 35 functions how will be performance. I am just looking for the best approach for this.


Thanks
Naren
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jun 29, 2006 12:55 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Having 35 functions instead of 1 should not affect performance ( I would be more concerned about maintainability). I expect it would perform better if you could model the entire message using a single message definition - but that's not possible.
Back to top
View user's profile Send private message
narki
PostPosted: Wed Jul 12, 2006 3:09 pm    Post subject: Reply with quote

Acolyte

Joined: 19 Dec 2005
Posts: 67

Can I use XMLTransformation node for this kind of scenario. Can I have XSLT whchi will transform Cobol Copybook to an XML. What about validation of those field. Please provide your input ASAP.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jul 13, 2006 12:32 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Can I have XSLT which will transform Cobol Copybook to an XML
No. XSLT converts XML -> XML or XML->string.
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 » WebSphere Message Broker (ACE) Support » Sequence of record is not fixed
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.