Author |
Message
|
foc |
Posted: Thu Aug 21, 2003 1:08 am Post subject: How to deal with optional (SWIFT) tags within the MRM? |
|
|
Newbie
Joined: 04 Sep 2002 Posts: 8 Location: Holland
|
I try to define a MT548 message within the MRM. The problem I have is how to deal with optional tags!?
Is it possible within the MRM to set a default value when a tag is not available in the input message.
Thanks,
foc. _________________ MQ Certified Specialist |
|
Back to top |
|
 |
Craig B |
Posted: Thu Aug 21, 2003 1:43 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
In the MRM, Default Values will only be used in Fixed Length Environments. Therefore, Default values will be written by the MRM when using the CWF physical format, and the Fixed Length Data Element separation techniques in TDS. If the element you which to write a default for in the MT548 structure is contained witin a Fixed length parent then you can do it. If it is not, then you would have to write your ESQL to look for the missing fields, and create them in your output message. _________________ Regards
Craig |
|
Back to top |
|
 |
foc |
Posted: Thu Aug 21, 2003 3:02 am Post subject: How to deal with optional (SWIFT) tags within the MRM? |
|
|
Newbie
Joined: 04 Sep 2002 Posts: 8 Location: Holland
|
Thanks,
Writing ESQL code to find out missing tags is not easy. I tried to do this but no succes so far. For example if you have the following repeating subsequence:
:16R:LINK
:13A::LINK//512
:20C::POOL//z
:16S:LINK
where 13A tag is optional, how can I check this within ESQL?
foc _________________ MQ Certified Specialist |
|
Back to top |
|
 |
foc |
Posted: Thu Aug 21, 2003 3:04 am Post subject: |
|
|
Newbie
Joined: 04 Sep 2002 Posts: 8 Location: Holland
|
Craig B wrote: |
In the MRM, Default Values will only be used in Fixed Length Environments. Therefore, Default values will be written by the MRM when using the CWF physical format, and the Fixed Length Data Element separation techniques in TDS. If the element you which to write a default for in the MT548 structure is contained witin a Fixed length parent then you can do it. If it is not, then you would have to write your ESQL to look for the missing fields, and create them in your output message. |
Thanks,
Sorry wrong button.
Writing ESQL code to find out missing tags is not easy. I tried to do this but no succes so far. For example if you have the following repeating subsequence:
:16R:LINK
:13A::LINK//512
:20C::POOL//z
:16S:LINK
where 13A tag is optional, how can I check this within ESQL?
foc _________________ MQ Certified Specialist |
|
Back to top |
|
 |
Craig B |
Posted: Thu Aug 21, 2003 3:09 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Hi,
If you have parsed against the Swift Message Set, then you will have a message tree for your MT548 message body section. If you want to check if the 13A field existed in your input message, then you can specify something like :
IF InputRoot.MRM.FIN.TEXT_BLOCK.MT548.A.13A IS NULL THEN
SET OutputRoot.MRM.FIN.TEXT_BLOCK.MT548.A.13A = 'Default';
END IF;
As you say, this can be a painful task when you have to check for any number of these. _________________ Regards
Craig |
|
Back to top |
|
 |
foc |
Posted: Thu Aug 21, 2003 3:41 am Post subject: |
|
|
Newbie
Joined: 04 Sep 2002 Posts: 8 Location: Holland
|
Craig B wrote: |
Hi,
If you have parsed against the Swift Message Set, then you will have a message tree for your MT548 message body section. If you want to check if the 13A field existed in your input message, then you can specify something like :
IF InputRoot.MRM.FIN.TEXT_BLOCK.MT548.A.13A IS NULL THEN
SET OutputRoot.MRM.FIN.TEXT_BLOCK.MT548.A.13A = 'Default';
END IF;
As you say, this can be a painful task when you have to check for any number of these. |
Thanks,
But if you have the following repeating sequence:
(0x300000B)e_16R = 'LINK'
(0x300000B)e_20C = ':POOL//x'
(0x300000B)e_16S = 'LINK'
(0x300000B)e_16R = 'LINK'
(0x300000B)e_13A = ':LINK//512'
(0x300000B)e_20C = ':POOL//z'
(0x300000B)e_16S = 'LINK'
(0x300000B)e_16R = 'LINK'
(0x300000B)e_13A = ':LINK//513'
(0x300000B)e_20C = ':POOL//z'
(0x300000B)e_16S = 'LINK'
(0x300000B)e_16S = 'GENL'
In the first occurence a 13A tag is missing. How can I write my ESQL code to detect this? You have to work with counters some how! The problem is that the first 13A tag is filled with ':LINK//512'! _________________ MQ Certified Specialist |
|
Back to top |
|
 |
Craig B |
Posted: Thu Aug 21, 2003 4:04 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Yes ... i see your point with that particular example. The First instance in the message tree will not be the omitted element, but the first one that it parsed. Unfortuntalely in TDS, omitted element take precedence over NULL handling so you cant even force an element into the message tree that will write an element with a NULL value.
This would mean that you would have to have the knowledge that an element could have been omitted be previous to the first occurence that is actually in the message tree. This would seem to suggest that checking for this possible present of this element becomes a matter of pointing a REFERENCE variable at the first child in the structure and then navigate the SIBLING checking the field names to make some judgement as to whether your optional element is there or not.
But then this could become a long winded task. I'll have to have a think about that scenario, and hopefully in the mean-time some bright spark will append a solution.  _________________ Regards
Craig |
|
Back to top |
|
 |
foc |
Posted: Thu Aug 21, 2003 5:42 am Post subject: |
|
|
Newbie
Joined: 04 Sep 2002 Posts: 8 Location: Holland
|
Craig B wrote: |
Yes ... i see your point with that particular example. The First instance in the message tree will not be the omitted element, but the first one that it parsed. Unfortuntalely in TDS, omitted element take precedence over NULL handling so you cant even force an element into the message tree that will write an element with a NULL value.
This would mean that you would have to have the knowledge that an element could have been omitted be previous to the first occurence that is actually in the message tree. This would seem to suggest that checking for this possible present of this element becomes a matter of pointing a REFERENCE variable at the first child in the structure and then navigate the SIBLING checking the field names to make some judgement as to whether your optional element is there or not.
But then this could become a long winded task. I'll have to have a think about that scenario, and hopefully in the mean-time some bright spark will append a solution.  |
Hi,
Maybe I got a solution for the above problem. See the following trace output:
(0x1000013)e_MT548BodyTest = (
(0x1000013)e_AGeneralInfo = (
(0x300000B)e_16R = 'GENL'
(0x300000B)e_20C = ':SEME//01522'
(0x300000B)e_23G = 'CAST/A2C4'
(0x1000013)e_SA98_Choice = (
(0x300000B)e_98A = ':PREP//19991231'
)
(0x1000013)e_A1Subsequence = (
(0x300000B)e_16R = 'LINK'
(0x300000B)e_13A = ':LINK//513'
(0x300000B)e_20C = ':POOL//x'
(0x300000B)e_16S = 'LINK'
)
(0x1000013)e_A1Subsequence = (
(0x300000B)e_16R = 'LINK'
(0x300000B)e_13A = ':LINK//512'
(0x300000B)e_20C = ':POOL//z'
(0x300000B)e_16S = 'LINK'
)
(0x1000013)e_A1Subsequence = (
(0x300000B)e_16R = 'STAT'
)
(0x300000B)e_25D = ':CPRC/A2C4E6G8/A2C4'
(0x300000B)e_16S = 'STAT'
(0x300000B)e_16S = 'GENL'
)
)
It seems to be working for the 13A optional tag. The next problem I have is the 16R = 'STAT' tag of the following subsequence in the message. This tag should be in the next element and not in element e_A1Subsequence.
Maybe you can answer for this?
Thanks so far
foc _________________ MQ Certified Specialist |
|
Back to top |
|
 |
|