ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker (ACE) Supportnot able to handle extra comma using csv files

Post new topicReply to topic
not able to handle extra comma using csv files View previous topic :: View next topic
Author Message
vijsam
PostPosted: Wed Jul 20, 2011 4:02 am Post subject: not able to handle extra comma using csv files Reply with quote

Apprentice

Joined: 01 Jun 2011
Posts: 46

Hello Iam using WMB 6.1 on windows,i have

sample record:
1,2,3,4
5,6,7,8

i have set the following properties in the message set

Messaging Standard: CSV – Comma Separated Values
Data element separation settings:
Group Indicator:
Group Terminator:
Delimiter: ,
Suppress Absent Element Delimiters: Never
Distinguish tag and data values using:
Tag Data Separator:
Length of Tag:
Character data settings:
Default CCSID: 376
Fixed length strings:
Trim on input: No Trim
Truncate on output: Not checked
Quote character: “
Reserved Characters:,<CR><LF>”


when i use 3 commas it is parsing successfully.
even if i use 2 or 4 commas it is parsing successfully.
but it has to fail.

Please need your asistance.Thanks in advance.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 20, 2011 4:11 am Post subject: Re: not able to handle extra comma using csv files Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

vijsam wrote:
when i use 3 commas it is parsing successfully.
even if i use 2 or 4 commas it is parsing successfully.
but it has to fail.


I'm slightly confused (as is so often the case). It seems you've got a record with 4 comma delimited values, the record itself delimited with end of line. You have a business requirement for validation of the record to fail unless there are exactly 4 values (separated by 3 commas).

I don't see anything in your post that's trying to enforce that. It looks a lot like the standard message set you get when you tell WMB you're using a CSV (which can have any number of values obviously enough).

So what have you done to enforce this rule (if I have your situation correctly)? What happened when you tried it (error messages, shape of the parsed message in a user trace)?

Better information, better advice.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
vijsam
PostPosted: Wed Jul 20, 2011 4:21 am Post subject: Reply with quote

Apprentice

Joined: 01 Jun 2011
Posts: 46

I have added Min occurences and max occurences as per requirement In MDF,and in RCD node we set property of validate to ->content and value.So if there are 4 elements there should be 3 commas,so if the customer is sending more or less commas for the record it has to fail.Any help highly apricated...thanks once again.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 20, 2011 4:28 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

vijsam wrote:
I have added Min occurences and max occurences as per requirement


Where? To what element(s) of the message set? Where did you mention this in your original post??

vijsam wrote:
In MDF,and in RCD node we set property of validate to ->content and value.


What do you mean by MDF in this context?

vijsam wrote:
Any help highly apricated


What does a user trace show you about how the message is being parsed and the message tree built? Any clues there about what's happening to ignore / fail to apply these limits?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
vijsam
PostPosted: Wed Jul 20, 2011 4:50 am Post subject: Reply with quote

Apprentice

Joined: 01 Jun 2011
Posts: 46

sorry I mean MDF-->MessageDefination File.Our flow is FileNode-->Computenode-->RouteNode-->LableNode-->RCD node-->Compute node-->WTX map node-.It is passing succesefully and after RCD node it is failing in WTX map node.one or more input is invalid.
( WTX map failure).while debugging my i can see under MRM Messagetree structure it shows
a-->1
b-->2
c-->3
d-->,,
if i pass 1,2,3,,.
for the 4 th element i have enabled nillable property.
In The d value coming as ,, in the last field.


Last edited by vijsam on Wed Jul 20, 2011 5:27 am; edited 1 time in total
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 20, 2011 4:59 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

vijsam wrote:
It is passing succesefully and after RCD node it is failing in WTX map node.one or more input is invalid.
( WTX map failure)


Understand I don't know WTX from a hole in the ground, so I'll focus in the message up to that point

vijsam wrote:
while debugging


I didn't ask what you could see in the debugger - I asked what the user trace told you about the process of parsing and building. I'm not disputing that the message tree doesn't meet your needs (which is what the debugger is showing you); I'm asking what information is in the user trace about how it got like that.

vijsam wrote:
for the 4 th element i have enabled nillable property.


Why? If there have to be 4 values (with 3 commas) in this record why is the last one suddenly nillable?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jul 20, 2011 5:12 am Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

OK - so it looks as if TDS always creates the elements in the tree even if they are 'missing' from the input record. Otherwise your minOccurs=1 would have triggered a validation error, right?

You could value constraints ( MRM-speak for schema facets ) to the elements to disallow zero-length values. And if you wanted to, you could validate a lot more than just the length.
Back to top
View user's profile Send private message
vijsam
PostPosted: Wed Jul 20, 2011 5:33 am Post subject: Reply with quote

Apprentice

Joined: 01 Jun 2011
Posts: 46

Hi kimbert,

[OK - so it looks as if TDS always creates the elements in the tree even if they are 'missing' from the input record.]...No kimbert i have mis spelled it.

The d value coming as ,, in the last field.sorry for that.


So my question is how can i explicitly throw error if there are more or less commas in the input file.Please need your assistance.

Thanks once again.
Back to top
View user's profile Send private message
mattfarney
PostPosted: Wed Jul 20, 2011 9:30 am Post subject: Reply with quote

Disciple

Joined: 17 Jan 2006
Posts: 167
Location: Ohio

Wouldn't it be easier to create a Compute Node that manually validates the format using ESQL, given that the format is so simple?

-mf
Back to top
View user's profile Send private message
vijsam
PostPosted: Wed Jul 20, 2011 10:54 pm Post subject: Reply with quote

Apprentice

Joined: 01 Jun 2011
Posts: 46

I have just given a example here,we have arround 10 records which can be repeatative.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Jul 21, 2011 4:44 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

vijsam wrote:
So my question is how can i explicitly throw error if there are more or less commas in the input file.Please need your assistance.


You use the suggestion of kimbert and disallow zero-length fields. And/or limit the number of fields.

Your problem is not that you have too many or too few commas in the input file. Your problem is that you have too many or too few fields....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
WGerstma
PostPosted: Thu Jul 21, 2011 6:57 am Post subject: Reply with quote

Acolyte

Joined: 18 Jul 2011
Posts: 55

No idea what you really want to accomplish, but perhaps you can switch to a data pattern parsing where you exactly specify the input pattern of your line.

Perhaps something like

(.+\,){9}.+\r?\n

With 9 here representing the number of fields and commas you would need. At least with tinkering around you should be able to get a parsing exception when the input fails to match anything in your pattern.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Jul 21, 2011 7:03 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

WGerstma wrote:
No idea what you really want to accomplish, but perhaps you can switch to a data pattern parsing where you exactly specify the input pattern of your line.


This might work.

Or you could use the inbuilt features of the product.

Depending on what fits best with the individual circumstances.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker (ACE) Supportnot able to handle extra comma using csv files
Jump to:



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
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.