Author |
Message
|
PieterV |
Posted: Thu Aug 10, 2006 3:35 am Post subject: Converting data structure in Enviroment.Variables to BLOB |
|
|
Disciple
Joined: 04 Jan 2006 Posts: 164 Location: Belgium
|
I have a datastructure in:
Environment.Variables.BLOBTEMP = InputRoot.MRM;
this is:
Code: |
Environment.Variables.BLOBTEMP
|
|- REC0
|- ElementA
|- ElementB
|- REC1
|- ElementC
|- ElementD
|
I'm trying to cast this to BLOB:
i tried:
Code: |
Environment.Variables.BLOB = BITSTREAM( Environment.Variables.BLOBTEMP);
|
Code: |
Environment.Variables.BLOB = ASBITSTREAM( Environment.Variables.BLOBTEMP);
|
Code: |
Environment.Variables.BLOB = CAST(ASBITSTREAM( Environment.Variables.BLOBTEMP) AS BLOB);
|
Code: |
Environment.Variables.BLOB = CAST( Environment.Variables.BLOBTEMP AS BLOB);
|
this results always in Environment.Variables.BLOB BLOB = nothing
how can i parse that structure to a BLOB? Each of those element has a value, so there are no empty elements in the structure... |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Aug 10, 2006 3:56 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Read up in the documentation upon the ASBITSTREAM. You are not passing enough parameters... _________________ MQ & Broker admin |
|
Back to top |
|
 |
PieterV |
Posted: Thu Aug 10, 2006 4:29 am Post subject: |
|
|
Disciple
Joined: 04 Jan 2006 Posts: 164 Location: Belgium
|
you probably mean that we should pass parameters about the message set etc.
Am i correct?
if so, this is a problem for us. We created some virtual message with is not bound to a message set, and cannot be validated against one.
However we wish to have to structure of that virtual message in BLOB format. |
|
Back to top |
|
 |
jsanchose |
Posted: Thu Aug 10, 2006 4:35 am Post subject: |
|
|
Novice
Joined: 26 Apr 2006 Posts: 16
|
I think you need to define a MessageSet...
and type a sentence like:
SET Environment.Variables.BLOB =
CAST(ASBITSTREAM(Environment.Variables.BLOBTEMP
ENCODING 785 CCSID 500
SET yourMessageSet
TYPE yourMessageType
FORMAT yourMessageFormat
) AS CHARACTER CCSID 500 ENCODING 785);
NOTE: CCSID and ENCODING in this example are for EBCDIC.
Replace it with your own values.
Don´t change de parameters order if you don´t have any problem. |
|
Back to top |
|
 |
PieterV |
Posted: Thu Aug 10, 2006 4:52 am Post subject: |
|
|
Disciple
Joined: 04 Jan 2006 Posts: 164 Location: Belgium
|
@jsanchose
i tried your code.
it goest trough it without errors but the result is the same as mine: empty.
when i change Environment.Variables.BLOBTEMP to InputRoot.MRM (wich contains the same data), i get a CWF error.
That's because my virtual data structure doesnt match the logical structure of the message set because there are some records in the logical message that are not here. (altough i defined those missing records to be optional: mininum occurence is 0).
perhaps you have other ideas? |
|
Back to top |
|
 |
kimbert |
Posted: Thu Aug 10, 2006 5:33 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
How did you create Environment.Variables.BLOBTEMP? It needs to be owned by the MRM parser if you are going to serialize it using the MRM domain.
Code: |
CREATE LASTCHILD OF Environment.Variables Domain 'MRM' name 'BLOBTEMP' |
( untested code, but you get the idea ). That should sort out the first problem.
Quote: |
i get a CWF error.
That's because my virtual data structure doesnt match the logical structure of the message set because there are some records in the logical message that are not here. (altough i defined those missing records to be optional: mininum occurence is 0). |
I've already explained to you why the CWF writer is generating this error http://www.mqseries.net/phpBB2/viewtopic.php?t=31143. You cannot simply declare that fixed-length fields are optional. Omitting fields from the middle of a fixed-length message usually renders it unparseable. Have you set default values for the missing fields? |
|
Back to top |
|
 |
|