Page 1 of 1

Sequential file truncating integer

Posted: Thu Jun 11, 2015 6:51 pm
by bgs
Hi,
I have a parallel job with sequential file as source,and delimeter is ",". Input file has few integer columns. I noticed that if the value received in the integer field is "1 2" sequential file is reading "1" and truncating the rest. Did anyone have this issue and can I reject such records to reject link?
Thanks in advance.

Posted: Fri Jun 12, 2015 2:46 am
by ray.wurlod
The Sequential File stage scans the input stream until it finds a character that isn't part of an integer (or a delimiter) and returns that. Then it scans to find the next field or record delimiter. So it's working as designed.

Technically, the value "1 2" is NOT an integer, so maybe you need to set up a Filter command to tidy up the data. Or get "them" to provide clean data in the first place.

Beyond that, you could try reading the field as a VarChar data type, then use IsValid() function to detect whether or not it is a valid integer. "1 2" will fail that test.