|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
NULL HANDLING IN TDS |
« View previous topic :: View next topic » |
Author |
Message
|
rajaram |
Posted: Wed Feb 18, 2004 7:58 am Post subject: NULL HANDLING IN TDS |
|
|
Acolyte
Joined: 02 Jan 2004 Posts: 53
|
Hi,
I have a record which contains 4 fields seperated by commas. The records are repeating and they are delimeted by <lf>. Now,
el1,el2,el3,el4
el5,el6,el7,el8
el9,el10,el11,el12
...........
.......... etc...
Now, if the last element in a record is null(i.e., if either e4 or e8 or e12 is NULL)..my TDS parser is not recognizing...the next element. It parses only till the third element in that record. I cant use the validation option on INPUT node.
Can any one tell me how i can handle this??
Thanks,
Raja |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Feb 18, 2004 8:21 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
TDS does not like it when the last field is optional (could be null).
I don't know that there's a way around this without adding a final record that is not optional. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Missam |
Posted: Wed Feb 18, 2004 8:46 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
Not Recognising means is it giving parsing errors...? |
|
Back to top |
|
 |
rajaram |
Posted: Wed Feb 18, 2004 11:18 pm Post subject: |
|
|
Acolyte
Joined: 02 Jan 2004 Posts: 53
|
Hi,
thanks for replies.
I am not getting any errors in event viewer.
sorry. the delimeter for each record is cr,lf
the message structure looks like
compound type (all elements delimeted by cr,lf)
'
'----Compound elment(all elements delimted by, repeating element delimeter is cr,lf)
the compound element has 4 elements.
if i give data as
1,,3,4
5,5,6
4,6,1,3
it parses the first record. But not the second one it reads till the value 6.
But if i give the data as
1,,3,4
5,5,6,7
4,6,1,3
the parser works fine.
Please suggest a solution.
Thanks
raja |
|
Back to top |
|
 |
rajaram |
Posted: Wed Feb 18, 2004 11:21 pm Post subject: |
|
|
Acolyte
Joined: 02 Jan 2004 Posts: 53
|
sorry, the data should have been instead of what i gave in the previous message.
1,,3,4
5,5,6,
4,6,1,3
there is a comma after element 6.
thanks |
|
Back to top |
|
 |
wooda |
Posted: Thu Feb 19, 2004 1:31 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
Hi,
You say
Quote: |
if i give data as
1,,3,4
5,5,6
4,6,1,3
it parses the first record. But not the second one it reads till the value 6. |
What exactly do you mean ?
Do you get an exception or does it get parsed incorrectly ?
If it get's parsed incorrectly what do you get ?
What version of integrator (inc. CSD level) are you using ?
The only thing wrong with your model I can see is that you have a repeat element delimter on a record the same as the delimter on the parent type. This is ambiguos.
Are you trying to use null handling options ? ie. Do you expect the missing field to appear in the tree awith the value NULL? If it is missing it will not appear in the tree at all by default. |
|
Back to top |
|
 |
Missam |
Posted: Thu Feb 19, 2004 7:42 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
The Solution is you should define the Fourth Element Connection Property Repeat to Yes And Set MIn Occurs to 0 And Max Occurs to 1 and TDS Property Repeating Element Delimiter To What Ever You Want(Because if you say repeat min and max occurs to 0 and 1 it won't repeat more than once and chance of getting repeating delimiter is 0).
Hope this should help |
|
Back to top |
|
 |
rajaram |
Posted: Fri Feb 20, 2004 12:50 am Post subject: |
|
|
Acolyte
Joined: 02 Jan 2004 Posts: 53
|
Hi,
sam,i tried with connnection repeat to yes and changed the values of min and max occurs. But still it is
not working.
zanda, this is the actual data that i am using for testing the message set. the flow fails after value 6.
1,,3,4
5,5,6,
4,6,1,3
there is a comma after value 6. the value for element 4 in that record is empty(i.e. ',' is immediately
followed by cr,lf)
I can see in the debug mode that values are passed till value 6 after that nothing is parsed. It parses exactly
till the value 6. After that it doesnt parse any.If i get the cardinality in the compute node. it shows the
cardinality as 2,actually it should be 3 right??
I am using CSD level5. I am not getting any exceptions or parsing errors.
If i give some value after the 6, it parses. i.e, if the record is 5,5,6,4 it parses and i get cardinality as 3 which is correct, instead of 5,5,6 where i get the cardinality as 2.
Thanks
raja |
|
Back to top |
|
 |
wooda |
Posted: Fri Feb 20, 2004 1:24 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
Hi again,
Please trace the message (using a trace node after input).
And paste the result here.
Then we can see exactly what is happening. |
|
Back to top |
|
 |
rajaram |
Posted: Fri Feb 20, 2004 8:22 am Post subject: |
|
|
Acolyte
Joined: 02 Jan 2004 Posts: 53
|
Hi Zanda,
Please find the trace below.
my input is
AB,CAP,1,WER
SP,PQ,RS,
AA,BB,CC,DD
trace is::
(0x1000000)MQMD = (
(0x3000000)SourceQueue = 'dummy'
(0x3000000)Transactional = TRUE
(0x3000000)Encoding = 546
(0x3000000)CodedCharSetId = 437
(0x3000000)Format = ' '
(0x3000000)Version = 2
(0x3000000)Report = 0
(0x3000000)MsgType = 8
(0x3000000)Expiry = -1
(0x3000000)Feedback = 0
(0x3000000)Priority = 0
(0x3000000)Persistence = 0
(0x3000000)MsgId = X'414d512057533932363233382020202034db354020006e02'
(0x3000000)CorrelId = X'000000000000000000000000000000000000000000000000'
(0x3000000)BackoutCount = 0
(0x3000000)ReplyToQ = ' '
(0x3000000)ReplyToQMgr = 'WS926238 '
(0x3000000)UserIdentifier = 'db2admin '
(0x3000000)AccountingToken = X'1601051500000023484f366f21e61ca22e1750f803000000000000000000000b'
(0x3000000)ApplIdentityData = ' '
(0x3000000)PutApplType = 11
(0x3000000)PutApplName = 'db2admin\Desktop\rfhutil.exe'
(0x3000000)PutDate = DATE '2004-02-20'
(0x3000000)PutTime = GMTTIME '20:26:58.460'
(0x3000000)ApplOriginData = ' '
(0x3000000)GroupId = X'000000000000000000000000000000000000000000000000'
(0x3000000)MsgSeqNumber = 1
(0x3000000)Offset = 0
(0x3000000)MsgFlags = 0
(0x3000000)OriginalLength = -1
)
(0x100001B)MRM = (
(0x1000013)REC_ELEMENT = (
(0x300000B)EL1 = 'AB'
(0x300000B)EL2 = 'CAP'
(0x300000B)EL3 = '1'
(0x300000B)EL4 = 'WER'
)
(0x1000013)REC_ELEMENT = (
(0x300000B)EL1 = 'SP'
(0x300000B)EL2 = 'PQ'
(0x300000B)EL3 = 'RS'
) |
|
Back to top |
|
 |
wooda |
Posted: Mon Feb 23, 2004 5:10 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
Hi -
I recreated your problem.
It seems to only occur when you have the delimeter present after the last field.
eg.
AB,CAP,1,WER
SP,PQ,RS,
AA,BB,CC,DD
fails as you described,
Whilst
AB,CAP,1,WER
SP,PQ,RS
AA,BB,CC,DD
works ok.
So the parser is being thrown by the delimter.
Incidentatly I tried this is V5 and it works fine.
So whatever the problem is it's been fixed in v5.
So it might be worth raising a problem with IBM. |
|
Back to top |
|
 |
rajaram |
Posted: Mon Feb 23, 2004 5:13 am Post subject: |
|
|
Acolyte
Joined: 02 Jan 2004 Posts: 53
|
Hi,
I have finally come up with solution and it is to use data pattern on TDS. For any element in the record i have used [^,]* and for the last element in that record [^\r]* and repeating element delimeter will be cr,lf. ( I know it has some performance problems if we pass very huge data....when compared to other data element separation members but i couldnt find an alternative solutiion.)
Thanks for your Replies,
Raja |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|