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 » CREATE FIELD .... PARSE ....

Post new topic  Reply to topic
 CREATE FIELD .... PARSE .... « View previous topic :: View next topic » 
Author Message
EvolutionQuest
PostPosted: Wed Mar 10, 2004 2:09 pm    Post subject: CREATE FIELD .... PARSE .... Reply with quote

Voyager

Joined: 18 Sep 2001
Posts: 88
Location: Billings, MT

Does anyone have a good example of using the CREATE FIELD which uses the PARSE option?

I am trying to call a stored procedure (SP) that requires a COBOL copybook type structure as its input/output parm.

I was originally thinking about wrapping the SP with another one which took the fields as individual input and output parms based on field requirements.

What would be the best way to tackle this problem where I need to construct a single field with the proper input fields, and then extract those fields for the output. I sense it is easier to parse the return results easier than constructing the input, but any insight is greatly appreciated.

Thanks.

Chris
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
EddieA
PostPosted: Wed Mar 10, 2004 2:30 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Chris,

PARSE isn't an option on CREATE FIELD. It's only valid on FIRSTCHILD, LASTCHILD, PREVIOUSSIBLING, and NEXTSIBLING.

What, exactly, are you trying to do. Are you trying to create a single field that actually contains a structure. In which case ASBITSTREAM (or BITSTREAM) will do that. If the data comes back as a BLOB, then you could use CREATE ... PARSE to re-build an MRM or XML tree from it.

Or, have I misunderstood.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
EKhalil
PostPosted: Thu Mar 11, 2004 5:59 am    Post subject: Reply with quote

Voyager

Joined: 29 Apr 2003
Posts: 99
Location: Boston, MA

CREATE LASTCHILD OF Environment.Variables.MRM_Record DOMAIN 'MRM' PARSE (bitstream(InputBody), 785, 500, 'DP0U9J0086001', 'VehicleResponseMessage', 'CWF');

Hope this helps
Eva
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Thu Mar 11, 2004 6:52 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

[soapbox]You should not use BITSTREAM if you are running 2.1 CSD03 or greater. You should use ASBITSTREAM instead.[/soapbox]
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
EvolutionQuest
PostPosted: Thu Mar 11, 2004 7:13 am    Post subject: Reply with quote

Voyager

Joined: 18 Sep 2001
Posts: 88
Location: Billings, MT

Well, just typed my response and something blew it away. Anyway I have no idea at times what I am doing, then again I have been wondering that for years

What I am trying to do is construct the following into one input variable for the SP:

10 FIELD1 PIC X(15).
10 FIELD2 PIC 9(2).
10 FIELD3.
15 FIELD3-NO-IDEA.
17 FIELD3-NO-REAL-IDEA PIC X(12).
17 FIELD3-NO-REAL-1.
20 FIELD3-REAL-1 PIC X(1).
20 FILLER PIC X(15).

and then that same structure will come back to me in one output parm which I'll need to parse. The this part is simple, but the first portion doesn't seem to make sense. In ESQL I don't see how I can concat() FIELD1 for the full size of character 15 with FIELD2 which is a integer.

Hope this makes more sense.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
EddieA
PostPosted: Thu Mar 11, 2004 7:32 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Chris,

I think you would have to build an MRM that describes this. Built it, and then ASBITSTREAM it to get the BLOBed version.

On return, you can build a tree from the BLOB, by PARSING it.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
JLRowe
PostPosted: Thu Mar 11, 2004 9:26 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

Just to clarify how BITSTREAM and ASBITSTREAM differ.

BITSTREAM returns the bitstream of the current message, typically the orignal serialised message recieved by the MQInput node. Any changes made to the message in the message tree are not reflected in the ouput of BITSTREAM.

ASBITSTREAM takes the message tree, serialises it via the owning parser (as an MQOutput node would do), and does reflect changes made to the message tree.
Back to top
View user's profile Send private message Send e-mail
neo_revolution
PostPosted: Thu Mar 11, 2004 9:59 am    Post subject: Reply with quote

Voyager

Joined: 21 Oct 2003
Posts: 80
Location: NJ

I tried to access something like this

CREATE LASTCHILD OF Environment.Variables.Temp DOMAIN 'XML' PARSE (ASBITSTREAM(InputRoot.XML.Header), 0, 437, '', '', 'XML');

It created Environment tree whicl looke like this
<Environment>
<Variables>
<Temp>
<XML>
............

I wonder why XML tag is being created??
Back to top
View user's profile Send private message Yahoo Messenger
EddieA
PostPosted: Thu Mar 11, 2004 10:34 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Because that's the way it works.

If you PARSEd using the MRM domain, it would put MRM as the leading tag.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
EKhalil
PostPosted: Thu Mar 11, 2004 11:01 am    Post subject: Reply with quote

Voyager

Joined: 29 Apr 2003
Posts: 99
Location: Boston, MA

I think that will be the domain 'XML' . When the domain is 'MRM' the first element is 'MRM'
"...0x1000021)MRM = (
(0x300000B)ERROR_INFO_CNT = 2
(0x300000B)MESSAGE_INFO_CNT = 1..."
Back to top
View user's profile Send private message Send e-mail
EvolutionQuest
PostPosted: Sun Mar 14, 2004 2:01 pm    Post subject: Reply with quote

Voyager

Joined: 18 Sep 2001
Posts: 88
Location: Billings, MT

O.K. I don't follow on creating an area that I can put in place as an MRM, update the specific fields of that MRM, and then send it as a bitstream. It just isn't clicking for me.

Code:

CREATE LASTCHILD OF Environment.Variables.MRM_Record DOMAIN 'MRM' PARSE (bitstream(InputBody), 785, 500, 'DP0U9J0086001', 'VehicleResponseMessage', 'CWF');


I don't understand how I can create a MRM field from a specific message set that needs to be sent to a SP as a bitstream. What is the syntax needed to do this? The only place I see that I can use a message set name is in the parse option for previoussibling/nextsibling.

I need a little help here.

Just to re-iterate what I am trying to accomplish. I need to construct a fixlength blob that will be sent to a stored procedure. I first need to set the values in the blob before sending it off to the SP. Then I will get back a BLOB which I can parse using the PARSE feature of CREATE. The road block for me is the first portion on creating a reference to a specific message set that has nothing to do with the InputBody/OutputBody. It is a special case where I need to create a MRM type field, update specific fields, then convert it to a bitstream and call the SP.

[/code]
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
EddieA
PostPosted: Mon Mar 15, 2004 9:59 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Chris, you're going to have to build a "dummy" Output tree, using an MRM that describes the BLOB you require, and then ASBITSTREAM it. That should force WMQI to serialise it.

Then you can set the tree to NULL, and build your 'real' Output.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
EvolutionQuest
PostPosted: Wed Mar 17, 2004 5:40 am    Post subject: Reply with quote

Voyager

Joined: 18 Sep 2001
Posts: 88
Location: Billings, MT

I should of thought about this before. The answer is to declare a variable of a type, i.e. BLOB, CHAR, and so forth. Then use the OVERLAY function to lay in the values at their respective location. On the return parm I can either use a SUBSTRING() or just use CREATE ... PARSE and identify the message set and so forth.

All I can say is Duh!
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » CREATE FIELD .... PARSE ....
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.