Author |
Message
|
anil kumar |
Posted: Thu Feb 16, 2017 11:03 pm Post subject: DFDL |
|
|
 Voyager
Joined: 22 Jan 2017 Posts: 98 Location: India
|
hi all , i m creating a dfdl which should accpet the below input
101 1
key 1
201 1
202 1
203 1
101 2
key 2
201 2
202 3
203 4
ans should return multiple records based on the 101 record and key record
if key is same i,e key 1
then output need to be
101 1
key 1
201 1
202 1
203 1
201 2
202 3
203 4
if key is different then it should be somthing like this
101 1
key 1
201 1
202 1
203 1
101 2
key 2
201 2
202 3
203 4
i have tried using sequence but its not iterating |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Feb 17, 2017 12:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
So you have one group that is a repeating group:
101 1
key 1
201 1
202 1
203 1
And at the end of this group you have an optional (repeating ? ) group:
201 2
202 3
203 4
or
main repeating group:
101 1
key 1
Repeating group (occurs 1 to n)
201 1
202 1
203 1
What have you done to model it that way?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
anil kumar |
Posted: Fri Feb 17, 2017 1:41 am Post subject: |
|
|
 Voyager
Joined: 22 Jan 2017 Posts: 98 Location: India
|
if the input is this it need parse as it is
101 1
key 1
201 1
202 1
203 1
if the same parser fed this input -->101 1
key 1
201 1
202 1
203 1
101 1
key 1
201 1
202 1
203 1
repeating then output parser should parse only
101 1
key 1
and
201 1
202 1
203 1
201 2
202 2
203 2 |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Feb 17, 2017 4:38 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
The output parser isn't a parser, not really. It's a serializer. It will take whatever you give it in the logical message tree, and turn it into a string(more or less). _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
Vitor |
Posted: Fri Feb 17, 2017 6:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
The output parser isn't a parser, not really. It's a serializer. It will take whatever you give it in the logical message tree, and turn it into a string(more or less). |
Focus on the input model. You need some kind of discriminator / logic test to determine if the key field has changed and if the input record being parsed is part of the same logical message as the previous one or not.
As a side issue, this is a really dumb record layout. I except you didn't come up with this, probably agree that it's dumb and are still stuck with it, but you might want to pass a little criticism up the command chain. if you ever get a situation where the key value following the 101 is not grouped together, this will break. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
anil kumar |
Posted: Sun Feb 19, 2017 3:28 am Post subject: |
|
|
 Voyager
Joined: 22 Jan 2017 Posts: 98 Location: India
|
if i used the descriminator it say that the test condition has failed and parsing is ending at that instance only what to do in dfdl message model if want to do something like is the condiion true do this if failed do the next record ..
something like if statement ?? |
|
Back to top |
|
 |
|