Author |
Message
|
madi |
Posted: Thu Jul 24, 2008 11:56 am Post subject: mrm fill empty fields |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
hello all
i have simple question about mrm.
if i have 1000 fields in mrm and would only need 2 or 3, would i have to set all the 1000 in esql to null?
i think there is a solution for this and it is "Null Handling" and i tried setting the fields as Nullable but it didnt change anything and i was getting an empty message out
could someone tell me at what level we need to set the Nullable property .... i mean if i have
Code: |
Parent
------Child Element
-------------Child Element
-------------Child Element
|
i tried setting Nullable for the inner most element but nothing happened
thanks
madi _________________ IBM Certified Solutions Developer - WMB 6.0 |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jul 24, 2008 12:04 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You need to create the field and set the value to null.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jul 24, 2008 12:05 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
if i have 1000 fields in mrm and would only need 2 or 3, would i have to set all the 1000 in esql to null? |
I don't understand the question. Please supply more details. |
|
Back to top |
|
 |
sridhsri |
Posted: Thu Jul 24, 2008 12:07 pm Post subject: |
|
|
Master
Joined: 19 Jun 2008 Posts: 297
|
What kind of messages are these ?
Have you tried using minOccurs = 0 ?
Is it possible for you to define a "choice" ?
Have you tried using content validation as "Open Defined" ? |
|
Back to top |
|
 |
madi |
Posted: Thu Jul 24, 2008 12:32 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
ok more details
i have a tds MRM message defined
data1|data2|data3|.....................|data1000
data1|data2|.....................
so my question in tha 1000 data fileds that i have defined
if i set only 2 or 3 in eSQL
like SET data1 = 'something';
set data2 = 'something;
RETURN TRUE
can MRM give me an output with something|something|||||||.... 1000
--madi _________________ IBM Certified Solutions Developer - WMB 6.0 |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jul 24, 2008 1:16 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
madi wrote: |
ok more details
i have a tds MRM message defined
data1|data2|data3|.....................|data1000
data1|data2|.....................
so my question in tha 1000 data fileds that i have defined
if i set only 2 or 3 in eSQL
like SET data1 = 'something';
set data2 = 'something;
RETURN TRUE
can MRM give me an output with something|something|||||||.... 1000
--madi |
OK now we're getting somewhere.
Define you null value to be space filled.
Create a blob with max space length all fields or in your case 1000 times something like field = field || '|';
Do a create last child of parse.... the space blob.
This should create you the 1000 fields with null value.
Now populate your 3 or 4 fields.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jul 24, 2008 1:45 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
madi |
Posted: Thu Jul 24, 2008 1:53 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
ok im lost here
ill try to give a better description of what im trying to do
forget the tds message, lets say i have a fixed length positional message with a 100 fields
I have hte mrm definition file created and ready to go
in the compute i set the output properties to set, type and format of the message set
now what i do right now is
Set mrm.data1 = 'something';
set mrm.data2 = 'something';
...
...
set mrm.data24 = '';
set mrm.data25 = '';
...
...
set mrm.data99 = 'something';
set mrm.data100 = something;
so my question was can eliminate the code in the middle which is setting the empty fields and have mrm do that for me? that way i only have to worry about the fields that i actually need and forget abt the ones i dont care abt
im sure this can be done ...... but dont know which property to set and where hope this gives a better picture
--madi _________________ IBM Certified Solutions Developer - WMB 6.0 |
|
Back to top |
|
 |
sridhsri |
Posted: Thu Jul 24, 2008 4:23 pm Post subject: |
|
|
Master
Joined: 19 Jun 2008 Posts: 297
|
kimbert has already answered that question. I am quoting from the info center:
Quote: |
Suppress Absent Element Delimiters: "Never" Use this option to ensure that even if optional elements are not present, all delimiters are written out.
|
You said you have a TDS message. On the complex type that holds the 1000 elements, click on the physical properties and set this option. Then if you don't set a value to some element, just the delimiter will appear. However, make sure that you have minOccurs=0 for all those optional elements. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jul 24, 2008 7:36 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
madi wrote: |
ok im lost here
i'll try to give a better description of what i'm trying to do
forget the tds message, lets say i have a fixed length positional message with a 100 fields
so my question was can eliminate the code in the middle which is setting the empty fields and have mrm do that for me? that way i only have to worry about the fields that i actually need and forget abt the ones i dont care abt
im sure this can be done ...... but dont know which property to set and where hope this gives a better picture
--madi |
OK.
Again create a msg with max length all spaces
DECLARE mymsgtxt = space(x)
In the message set have space marked as the null value and padding value.
Use the message set to parse this created text. This will create all the fields with a null value.
Set your 3 or 4 fields.... you're good to go!.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
madi |
Posted: Fri Jul 25, 2008 5:27 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
thats what i was looking for
thanks
madi _________________ IBM Certified Solutions Developer - WMB 6.0 |
|
Back to top |
|
 |
madi |
Posted: Mon Jul 28, 2008 7:40 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
i did set the Suppress Absent element delimiters to "Never"
I am setting the 2 fields in the output message and im getting an empty output message with just the delimiters
Code: |
set outputroot.MRM.Parent.Child1 = 'set';
set outputroot.MRM.Parent.Child2 = 'asdasd';
|
Output:
Quote: |
""|""|""|""|""|""|""|""|""|""|||""|""|""|""|""|""|""|""|""|""|"" |
what am i doing wrong?
--madi _________________ IBM Certified Solutions Developer - WMB 6.0 |
|
Back to top |
|
 |
kimbert |
Posted: Mon Jul 28, 2008 10:48 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
- have you taken a debug-level user trace?
- have you inserted a Trace node in your message flow?
These are basic diagnostic procedures, and they can be done in 5 minutes - at least do the obvious stuff before posting a question. |
|
Back to top |
|
 |
madi |
Posted: Mon Jul 28, 2008 12:03 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
thanks kimbert .......... getting too hard headed now a days
its sorted ......... not sure why it didnt work
but anyway one thing i noticed is that the order of the fields has to be preserved while setting them
for example we can set field1 and then skip a few and set field5 but we cannot come to field3
which kind of makes sense?
--madi _________________ IBM Certified Solutions Developer - WMB 6.0 |
|
Back to top |
|
 |
kimbert |
Posted: Mon Jul 28, 2008 1:29 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Glad you sorted it out. A little something for you to ponder next time you struggle with an MRM problem...
Quote: |
one thing i noticed is that the order of the fields has to be preserved while setting them |
You would have noticed even sooner if you had used user trace. It tells you about self-defining fields in the message tree ( i.e. fields which were not matched against the message model ).
...oh, and did I mention user trace yet?  |
|
Back to top |
|
 |
|