Author |
Message
|
Ajju. |
Posted: Tue Nov 19, 2002 5:52 am Post subject: ESQL & dynamic field names |
|
|
 Voyager
Joined: 26 Jul 2002 Posts: 77
|
Hi All,
IS there a Way for converting ouput in TDS format taking input values:
i.e if the input is.
<TAG1>VALUE1</TAG1>
<TAG2>VALUE2</TAG2>
<TAG3>VALUE3</TAG3>
<TAG4>VALUE4</TAG4>
ouput shud be:
actual value of TAG1:value of TAG2||value of TAG3:value of TAG4||
I.e
VALUE1:VALUE2||VALUE3:VALUE4||
Thanks in adv,
Ajju. |
|
Back to top |
|
 |
Yanghui |
Posted: Tue Nov 19, 2002 7:54 am Post subject: |
|
|
Disciple
Joined: 08 May 2002 Posts: 151 Location: Dublin, Ireland
|
Hi, Ajju,
You can use TDS in MRM to define a msg type with two string elements, E1 and E2. The msg type should be specified "All Element Delimited" for Data Element Seperation and "||" for Delimiter.
In your Compute node, you just need to do something similar as below,
SET OutputRoot.Properties.MessageSet = 'DOGO76O08E001';
SET OutputRoot.Properties.MessageType = 'M1';
SET OutputRoot.Properties.MessageFormat = 'TDS';
DECLARE E1 AS CHAR;
DECLARE E2 AS CHAR;
SET E1 = RefIn.TAG1 || ':' || RefIn.TAG2;
SET E2 = RefIn.TAG3 || ':' || RefIn.TAG4;
SET "OutputRoot"."MRM"."E1" = E1;
SET "OutputRoot"."MRM"."E2" = E2;
Don't forget to include the msgset in your compute node.
Hope it helps.
-Yanghui |
|
Back to top |
|
 |
Ajju. |
Posted: Tue Nov 19, 2002 8:55 am Post subject: |
|
|
 Voyager
Joined: 26 Jul 2002 Posts: 77
|
thanks Yanghui,
I tried it and the output is something like :
E1:VALUE1:VALUE2||E2:VALUE3:VALUE4||
what i am expecting at the output is
VALUE1:VALUE2||VALUE3:VALUE4||
help is appreciated.
Thanks,
Ajju. |
|
Back to top |
|
 |
seeknee |
Posted: Wed Nov 20, 2002 3:21 am Post subject: |
|
|
 Apprentice
Joined: 08 Aug 2002 Posts: 41 Location: Melbourne, Australia
|
Hi
You could try using NEON.
I know its not the best way of doing it but it works
Hopefully this helps |
|
Back to top |
|
 |
lung |
Posted: Wed Nov 20, 2002 4:42 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Ajju,
Instead of
Code: |
SET "OutputRoot"."MRM"."E1" = E1;
SET "OutputRoot"."MRM"."E2" = E2; |
Try
Code: |
SET "OutputRoot"."MRM" = E1;
SET "OutputRoot"."MRM" = E2; |
 _________________ lung |
|
Back to top |
|
 |
Ajju. |
Posted: Thu Nov 21, 2002 8:18 am Post subject: |
|
|
 Voyager
Joined: 26 Jul 2002 Posts: 77
|
Thanks lung for your reply.
well this
SET "OutputRoot"."MRM" = E1;
SET "OutputRoot"."MRM" = E2;
will give me VALUE1:VALUE2||VALUE3:VALUE4||
and it will work only i have limited elements that is when i know E1, E2..... but what if i have a loop and the output is something like.
while c< = 10 do
SET "OutputRoot"."MRM".E[c] = E[c];
SET c = c+1;
end while;
i cannot do something like :
SET "OutputRoot".MRM[c] = E[c];
instead of
SET "OutputRoot"."MRM".E[c] = E[c];
In short the bottomline is can i set output elements names dyanamically using a counter or a loop.
advice is appreciated
thanks in adv.
Ajju. |
|
Back to top |
|
 |
lung |
Posted: Thu Nov 21, 2002 10:14 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
I think there is a way to output element names dynamically... Take a look at the CREATE FIELD chapter in the ESQL Reference .pdf file.
I haven't really use this function before, so I don't think I will be of much help in this case  _________________ lung |
|
Back to top |
|
 |
|