Author |
Message
|
learnmq2014 |
Posted: Thu May 08, 2014 12:42 pm Post subject: DFDL properties |
|
|
Newbie
Joined: 08 May 2014 Posts: 4
|
I have a message that has 2 TRLs in the file. When the flow picks it up, it processes the message before the 1st TRL and then throws an exception. I do not want to process any messages in the file if it has multiple TRL. Is there any property on DFDL I need to set up. |
|
Back to top |
|
 |
kimbert |
Posted: Thu May 08, 2014 1:43 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I do not know what a 'TRL' is.
I do not know what file format you are using.
I do not know what DFDL properties you have experimented with.
It is difficult to give any useful advice at this point - except 'please explain with a lot more detail'. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
learnmq2014 |
Posted: Thu May 08, 2014 2:03 pm Post subject: |
|
|
Newbie
Joined: 08 May 2014 Posts: 4
|
Sample file:
HDR4087381003103916-0408 043517329 05/01/2014111111111111AAAA
DIS1003103916-0408 1003103916A
CRT1003103916-0408
ITM1003103916-0408 048000114781000000001
TRL
HDR7443790666574486-744 010260299 05/05/2014111111111111AAAA
DIS0666574486-744 0666574486T
CRT0666574486-744
ITM0666574486-744 040049436583600000002
TRL
Each message starts with HDR and DIS, CRT, ITM are part of the message. TRL is the delimiter that is used. But when the source application sends 2 TRLs in a file. After the 1st message is being processed. Only then a parser exception is taking place. Instead I want none of the msgs to be processed when there are 2 TRLs in the file.
I am using Length Kind: Implicit
Delimiters Terminator as : TRL%WSP*; |
|
Back to top |
|
 |
kimbert |
Posted: Thu May 08, 2014 2:29 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Thanks - that is a little clearer.
I assume that you are using a FileInput node, with 'Parsed Record Sequence' as the setting. So the first TRL record is being propagated and then the second one is producing an error. Is that correct?
I still do not understand why the second record produces a parsing error ( and you have not quoted the error, so I can't make a guess ).
It is probably not my business to ask, but why do you want to reject a file that contains two TRLs? It sounds like a reasonable thing to do, and IIB can easily process such a file. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
learnmq2014 |
Posted: Thu May 08, 2014 3:43 pm Post subject: |
|
|
Newbie
Joined: 08 May 2014 Posts: 4
|
We are using DFDL. If the messages gets processed after the 1st TRL, I do not have a problem. But it fails. So I have a file that a portion of it is processed and the rest is not. I do not want this scenario, I need the entire file to be processed or the entire file to be failed.
Error:
An error occurred whilst parsing with DFDL;Parameters - CTDP3002E: Unexpected data found at offset '5634' after parsing completed. Data: '0x54...'. |
|
Back to top |
|
 |
kimbert |
Posted: Fri May 09, 2014 12:02 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You started by saying this:
Quote: |
I do not want to process any messages in the file if it has multiple TRL. |
But now you are saying this:
Quote: |
If the messages gets processed after the 1st TRL, I do not have a problem. |
I think I understand what is happening - but you could have made it easier by describing your requirements more carefully!
- Your flow picks up a file
- Your flow parses the file using a DFDL model
- Your DFDL model is incorrect, because it can only handle a single record. So you get an error from DFDL when a second record is encountered.
- Your flow logic is incorrect because you are processing the first record [b]in a way that cannot be rolled back or reversed[b] before you know whether the file is valid.
So you need to do one of the following:
a) Fix your DFDL model so that it can parse multiple records. Or
b) Leave the DFDL model as-is and use Parsed Record Sequence on the FileInput node to process the file one record at a time.
Note that b) will be more efficient in memory usage. But it could make it hard for you to roll back any already-processed TRLs if one of the later TRLs contains an error that trips up the parser. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri May 09, 2014 4:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
learnmq2014 wrote: |
I am using Length Kind: Implicit
Delimiters Terminator as : TRL%WSP*; |
DFDL is right to raise an error your Terminator is wrong.
It should read: TRL%WSP*;%NL;
This way the next part is HDR...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
learnmq2014 |
Posted: Fri May 09, 2014 12:17 pm Post subject: |
|
|
Newbie
Joined: 08 May 2014 Posts: 4
|
Thanks All!!
I will be more careful in describing my requirements from now on.
Used "TRL%WSP*;%NL;" as the terminator and it helped me. |
|
Back to top |
|
 |
|