Author |
Message
|
SarithaRao |
Posted: Mon May 15, 2006 11:19 am Post subject: how to read the SWIFT message in ESQL & convert hex to A |
|
|
Newbie
Joined: 15 May 2006 Posts: 7
|
I have a SWIFT message coming in as BLOB. I need to read some values from SWIFT header and populate in the RFH header.
For ex: I need to find the '{2:O' and get the 540 from the below :
{1:F01XXXXXXXXXXXX0861222742}{2:O5401233060207XXXXXX33EXXX14952628790602070933N}{3:{108:1139333602362t90}}{4:
Currently I am using POSITION function with the value "7b323a4f"(blob value of "{2:O") to get the index of "{2:O", but i am not directly able use string '{2:O' in the position function, when i use i am not getting the index of that value:
POSITION('7b323a4f' in message)
Is there any way i can pass directly the string what i am looking for?
Secondly, after i use SUBSTRING to get the 540(BLOB variable)
and converted it to CHAR and i got the value " X'353430'" in it(hex value)...
I am populating this character variable in the RFH header, and it is looking like the below:
<msgType>X'353430'</msgType>
How to get the ASCII value(which is 540) from a character variable which contains the hex value in ESQL...
Is there any conversion functions available, if not how to do this?
Thanks! |
|
Back to top |
|
 |
dsriksha |
Posted: Mon May 15, 2006 11:53 am Post subject: Re: how to read the SWIFT message in ESQL & convert hex |
|
|
 Voyager
Joined: 27 Feb 2005 Posts: 95
|
Search this forum for CAST and POSITION |
|
Back to top |
|
 |
kimbert |
Posted: Tue May 16, 2006 12:58 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Two questions:
- Why not use the TDS parser to extract the message key from the header?
- Are you populating the RFH header so that you can parse against another message definition later on? If so, there's a much simpler way to do this. |
|
Back to top |
|
 |
SarithaRao |
Posted: Tue May 16, 2006 8:47 am Post subject: |
|
|
Newbie
Joined: 15 May 2006 Posts: 7
|
Kimbert,
Thanks for your reply!
- what is TDS parser? I am not using any message sets, is TDS parser relates to message sets?
- I am populating the RFH header to use that as subscription later... |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue May 16, 2006 9:21 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
So the whole point of this exercise is to touch as little data as possible, and then publish the message under the SWIFT message key?
You should reexamine dsrikasa's posting. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
SarithaRao |
Posted: Tue May 16, 2006 9:41 am Post subject: |
|
|
Newbie
Joined: 15 May 2006 Posts: 7
|
The whole point is i need to read the SWIFT message and get some values and populate those in the RFH header.
Please let me know how to do this? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue May 16, 2006 11:56 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
SarithaRao wrote: |
The whole point is i need to read the SWIFT message and get some values and populate those in the RFH header.
Please let me know how to do this? |
You can either model the message using the MRM, and extract the values by accessing them in the resulting message tree, or you can read up on CAST and POSITION, as dsriksha suggested, and see how to combine them to do what you want to do.
If you model the messages, then you can reuse the message set for different flows, like perhaps the SUBSCRIBER to these publications. _________________ I am *not* the model of the modern major general.
Last edited by jefflowrey on Tue May 16, 2006 1:03 pm; edited 1 time in total |
|
Back to top |
|
 |
SarithaRao |
Posted: Tue May 16, 2006 12:48 pm Post subject: |
|
|
Newbie
Joined: 15 May 2006 Posts: 7
|
I am currently using POSITION and CAST functions, but i am getting the hex value in it and i don't know how to CAST it to the ASCII value?
For ex: After i use POSITION and CAST, i have a CHAR variable with value "353430" and i need to convert this to ASCII value (540), could you please help? I didnt find any built in conversion functions...are there any?
Thank you! |
|
Back to top |
|
 |
SarithaRao |
Posted: Tue May 16, 2006 12:50 pm Post subject: |
|
|
Newbie
Joined: 15 May 2006 Posts: 7
|
And how to do model the message using MRM? Could you please give me any useful links which includes the step by step process and examples...
Thanks! |
|
Back to top |
|
 |
TheBigEasy |
Posted: Wed May 17, 2006 12:38 am Post subject: |
|
|
 Apprentice
Joined: 04 Jul 2005 Posts: 33 Location: London
|
Hi
The SWIFT samples that accompany the product should give you a good framework to learn from - is has a MT103 message set definition.
Best wishes |
|
Back to top |
|
 |
|