Author |
Message
|
Ramphart |
Posted: Mon Aug 09, 2004 3:50 pm Post subject: MRM TDS Question |
|
|
 Disciple
Joined: 21 Jul 2004 Posts: 150 Location: South Africa, JHB
|
I got the following data to parse:
HD,1,2,3,6,7
LN,a,b,c
LN,d,e,f
HD,k,l,m,f,h
LN,d,e,f
LN,d,e,f
HD indicates the header line and LN a line item and each HD and LN's below it forms one message. I can parse the data by using a Tag HD and LN for header, line respectively.
My question is, how can I parse the message and have the tag as part of the MRM fields. ie, my first field should by record type and contain the actual value HD or LN? At the moment if I parse the message while indicating HD as a tag my MRM message set has to start from the second field.
Regards,
Ramo _________________ Applications Architect |
|
Back to top |
|
 |
wooda |
Posted: Mon Aug 09, 2004 11:50 pm Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
If you wish to keep the LN and HD as part of the data then I suggest you use a TDS separaton of "Data Pattern" unlike using delimiters or tags the pattern will not remove anything from the message. However be aware it may not perform as well as using tags.
There are several ways you could do it depending on how you want the resulting message tree to look.
Using AED (delimiter = <CR><LF>) at the top level then a choice of LN of HD structure with a data pattern (regular expresion) to differenciate then another level of AED would be one way.
Regards,
- Alex |
|
Back to top |
|
 |
Ramphart |
Posted: Tue Aug 10, 2004 12:20 am Post subject: |
|
|
 Disciple
Joined: 21 Jul 2004 Posts: 150 Location: South Africa, JHB
|
Thx for the reply Alex. If data pattern is the only way to achieve this then I'll rather stick to my original MRM MessageSet using DES=Tagged Delimited and add this field back into the message tree in a compute node since I know what the values should be.
Regards _________________ Applications Architect |
|
Back to top |
|
 |
wooda |
Posted: Tue Aug 10, 2004 12:32 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
Hi Ramphart,
Out of interest is there any particular reason you don't want to go down the data pattern root. ? |
|
Back to top |
|
 |
Ramphart |
Posted: Tue Aug 10, 2004 12:39 am Post subject: |
|
|
 Disciple
Joined: 21 Jul 2004 Posts: 150 Location: South Africa, JHB
|
I don't want to use regular expressions as the client is not familiar with these. I'm developing the solution but they will maintain it. They prefer it to be as straight forword as possible. Regular expressions is easier to write than read in my opinion. I guess I have to do what's easiest for them to maintain. _________________ Applications Architect |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 10, 2004 5:12 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Can you explain WHY you want the tags as part of your message tree?
You don't need to put them back in your data before you write the message out, if you've done your modelling correctly.
You shouldn't, likewise, need them in order to identify what fields you have either. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Ramphart |
Posted: Wed Aug 11, 2004 3:24 am Post subject: |
|
|
 Disciple
Joined: 21 Jul 2004 Posts: 150 Location: South Africa, JHB
|
Hi,
The outgoing message has it's own tags (header, lines) which I’ve defined in its message set and those are populated automatically. The outgoing message has a separate field though that needs to be populated with the content of the incoming message line tag. Ideally I wanted to do a mapping from the incoming message field to the outgoing message field.
Hope this makes sense.
Regards, _________________ Applications Architect |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 11, 2004 5:35 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
That does make sense...
But unless the tags are going to change a lot, you can just set them as default values of the output message.
Otherwise, you can change your modeling to TDS delimited modeling.
But then you might have to write ESQL that will resolve choices for you. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wooda |
Posted: Wed Aug 11, 2004 6:30 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
Quote: |
But unless the tags are going to change a lot, you can just set them as default values of the output message. |
Jeff, the default value will only be populated if the output is fixed length TDS or CWF.
You could model the original message as TDS delimited and resolve the choices in ESQL.
Or avoid the need the extra ESQL by using a simple data pattern in the input format.
Or model the input with tags and populate the defaults yourself in ESQL. |
|
Back to top |
|
 |
|