Author |
Message
|
madi |
Posted: Thu Mar 23, 2006 1:39 pm Post subject: tagged delimited |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
Hi All
I am trying to create a flat file from XML.
I want to parse the incoming XML as a tagged delimited file. I have created a msg set.
can i use a statement like
CREATE FIELD .. ... PARSE(someblob, encoding, ccsid..)
where do i specify the msg set i want to parse to... if that makes sense.
I am going through the forum for flat file creation stuff but only finding the vice versa info. Im guessing that because its easy to do or something.
plz help
madi |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 23, 2006 1:44 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You need to map the fields in InputRoot.XMLNS to the appropriate fields in OutputRoot.MRM. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
madi |
Posted: Thu Mar 23, 2006 2:04 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
I guess that means we need a Msg Def file right? Correct me if im wrong a flat file is a generic data file right? or does it also have a defined structure and everything.
Can we just generate a tagged delinited file from an XML file?
I posted earliar about some validation stuff. i got a reply saying I can take the file in as blob and parse it to the MRM msg set . I want to try the same with this one.
mapping for me would be like OutputRoot.MRM = InputRoot.XML
--madi |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Mar 23, 2006 7:46 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi madi,
It woud make no sense to take the message as blob, then parse it with XML and then map it to tag delimited.
Get your message in as an XML...use a message set for it.
Create another message definition in TDS with no tags...if your flat file has fixed length fields then define the TDS as fixed lenght and append spaces or whatever...
Map the XML to the TDS...or if the structures is absolutely same then simply change the properties to point to the TDS message set and XML to MRM....
Should work.
Regards. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Mar 24, 2006 1:40 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I want to parse the incoming XML as a tagged delimited file |
Are you sure? I think what you are trying to do is parse the incoming XML message and write a tagged delimited message
Quote: |
can i use a statement like CREATE FIELD .. ... PARSE(someblob, encoding, ccsid..) |
No - that parses a bitstream and creates a tree. You want to do the opposite. You need ASBITSTREAM ( not BITSTREAM ).
Quote: |
where do i specify the msg set i want to parse to. |
It's one of the parameters of ASBITSTREAM
elvis_gn wrote:
Quote: |
Create another message definition in TDS with no tags |
But madi said that his output message is tagged delimited. Do you know something about madi's scenario that I don't? |
|
Back to top |
|
 |
elvis_gn |
Posted: Fri Mar 24, 2006 1:53 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi kimbert,
kimbert wrote: |
elvis_gn wrote:
Quote: |
Create another message definition in TDS with no tags |
But madi said that his output message is tagged delimited. Do you know something about madi's scenario that I don't? |
madi wrote: |
I am trying to create a flat file from XML. |
Regards. |
|
Back to top |
|
 |
madi |
Posted: Fri Mar 24, 2006 8:04 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
OK Here what I did. I cerated a msg def file with no fields but a msg type.
Code: |
SET OutputRoot.MRM = ASBITSTREAM(InputRoot.MRM, InputProperties.Encoding, InputProperties.CodedCharSetId, 'TestMsgSet', 'PM', 'TDS1'); |
Here is the error that I get. I know im doing something wrong.
Code: |
Error: Incoming message is self defining.
The message requiring writing is self-defining. TDS cannot write self-defining messages.
Check the message defining and flow. |
--madi |
|
Back to top |
|
 |
kimbert |
Posted: Fri Mar 24, 2006 8:37 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I cerated a msg def file with no fields but a msg type. |
Just checking: are you saying that the only thing in your message set is a single message called 'PM' with no contents? |
|
Back to top |
|
 |
madi |
Posted: Fri Mar 24, 2006 9:38 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
back to my original question!!
How do i create a msg def file for something that does not exist. the requirement is that i give a flat file or a tagged delimited file out of an xml file. thats all they say.
heres what i did
i created some elements in the TDS msg def file and mapped the mrm from input to the fields in output using mapping node.
then the msg format is showing as XML1 and I get this error
Code: |
Message Format 'XML1' does not match a Wire Format Identifier or a Format Name.
The Message Format is used to identify a Physical Format layer in the message set (via the Wire Format Identifier of the layer).
Message Set CI03DVO002001 did not contain any Physical Format layer with a Wire Format Identifier of 'XML1'.
The Message Format can also identify a bitstream worker by its name, but 'XML1' is not a valid name for a bitstream worker. 'xml','cwf','tds' and 'pdf' are valid names, and others may be available on your system.
If the Message Format was intended to identify a Physical Format layer, check that the Message Format has been specified correctly, and check that the message set has been deployed successfully.
If the Message Format was intended to refer to a bitstream worker, check that the appropriate bitstream worker file (dll or shared object) exists in the correct directory.
|
i think i should go do some research on tagged delimited file and flat file coz none of this makes sense to me!
--madi |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Mar 25, 2006 6:42 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
In my experience, a flat file is nothing more than a file.
Also, you're right. You can't create a message set for a structure that you don't know.
So either they need to tell you what the structure is, or you need to give them one (and, likely, then they will tell you "No, we want it like *this*, not like *that*").
The easiest thing for you to do is create a message set of the input XML. Then you can add a TDS physical layer, set max lengths where necessary and then set this as your output format. Then you will end up with a TDS bytestream that can be written to a file - somehow. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Mon Mar 27, 2006 12:43 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
What kind of TDS output message are you trying to produce?
Quote: |
i think i should go do some research on tagged delimited file and flat file coz none of this makes sense to me! |
I don't think you'll find the answers which you are looking for. The term 'Tagged Delimited file' just means a file which contains a mixture of data and markup. There are literally millions of possibilities. Similarly, the term 'flat file' can refer to a variety of actual file formats. In other words, it's not very helpful as a specification.
The error message which you quoted is just saying that the 'Format' property in the Properties folder of the message did not match a physical format name in any of the deployed message sets. That's nothing to do with file formats. However, I think the spec needs sorting before we debug your message flow. |
|
Back to top |
|
 |
madi |
Posted: Mon Mar 27, 2006 7:06 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
So here what I did:
Code: |
SET OutputRoot = InputRoot;
SET OutputRoot.Properties.MessageSet = 'TestMsgSet';
SET OutputRoot.Properties.MessageType = 'Transaction';
SET OutputRoot.Properties.MessageFormat = 'TDS1'; |
I can see the msg format set to TDS1 and others are fine. There is a MRM tag which has the XML data. But nothing goes to the output queue!!
if I add this :
Code: |
SET OutputRoot.MRM = ASBITSTREAM(InputRoot.MRM, InputProperties.Encoding, InputProperties.CodedCharSetId, 'TestMsgSet', '', 'TDS1'); |
I cant even see anything int he MRM tag, its empty!
I will meet with the TAs and find out about the file structure that they need, may be that will help.
Thanks all
--madi |
|
Back to top |
|
 |
kimbert |
Posted: Mon Mar 27, 2006 7:37 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You have set the message type parameter to '':
Quote: |
ASBITSTREAM (InputRoot.MRM, InputProperties.Encoding, InputProperties.CodedCharSetId, 'TestMsgSet', '', 'TDS1'); |
...so the MRM has no idea which message definition it is supposed to use. There will be some errors in the system log saying so.
After speaking to the TAs, you should probably read up about message sets and the MRM. It may be worth trying out one of the TDS samples ( the Video sample is quite good for MRM stuff ). |
|
Back to top |
|
 |
madi |
Posted: Mon Mar 27, 2006 7:44 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
Well the reason I did not include the message type is becoz I dont have any msg def file defined.
When I did have it though and did specify the msgtype, even then I did not get anything in the outputMRM tag.
i will try out the sample though, thanks for the advice.
--madi |
|
Back to top |
|
 |
kimbert |
Posted: Mon Mar 27, 2006 8:30 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You're going through the steep part of the learning curve with the MRM technology, and making the same mistakes that everyone makes on the way.
Here's a couple of pointers, just to show you that the broker is behaving quite reasonably:
- You can't parse non-XML data without a message definition. In other words, you can't just set the format to 'TDS' and expect the MRM ( or any other parser! ) to work out how to parse or write your message. As a bare minimum, you need to describe every field in your message, and define either a length or a delimiter for each one.
- You need to pay close attention to the error messages which the product emits. The MRM is quite good at telling you when something goes wrong. Often it's useful to post the errors along with your question - that proves that you've at least tried to solve the problem yourself. |
|
Back to top |
|
 |
|