Handling invalid data in data column

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
highpoint
Premium Member
Premium Member
Posts: 123
Joined: Sat Jun 19, 2010 12:01 am
Location: Chicago

Handling invalid data in data column

Post by highpoint »

Hi,

We are reading from the source view with the datatype as "Date" whereas the column is defined as timestamp in datastage.

The job has been working for a long time.But recently we started getting issue. The problem is this column is getting is some wierd data.
We implemented the ISValid() function.

The data is such that it passes the isvalid() but fails in the next stages.

If we run the SQL direclty against the Database. Only for that particular key we are getting the following error:

Code: Select all

select to_timestamp(start_date) from details
where id = 222
Gives the error" ORA-01847:day of month must be between 1 and last day of month"

How shall we handle this scenario.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What's the default Oracle date picture? Could bad data actually have been stored in the table by any means?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
highpoint
Premium Member
Premium Member
Posts: 123
Joined: Sat Jun 19, 2010 12:01 am
Location: Chicago

Post by highpoint »

ray.wurlod wrote:What's the default Oracle date picture? Could bad data actually have been stored in the table by any means?

Yes, bad data is present in table. But the job is failing, we want the job to handle this by making it to a default value or anything like that.

I tried using the ISvalid() then also that particular record with the wierd data is passing through.

I used dump function on the "date" column where my job is failing.

dump(start_date) returns "Typ=12 Len=7: 44,111,2,1,1,1,1" ---> For the record with issue
For all other record dump(start_date) returns "Typ=12 Len=7: 120,111,5,1,1,1,1".

Appreciate help.
sivanagu
Participant
Posts: 5
Joined: Sun May 29, 2005 4:46 pm

Re: Handling invalid data in data column

Post by sivanagu »

Hi,

How the wierd data is allowing to load in source table even the column defined as date.
highpoint
Premium Member
Premium Member
Posts: 123
Joined: Sat Jun 19, 2010 12:01 am
Location: Chicago

Re: Handling invalid data in data column

Post by highpoint »

sivanagu wrote:Hi,

How the wierd data is allowing to load in source table even the column defined as date.
That what we dont know. But we need to handle it in our code no matter what is the source sending.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Then try reading it as CAST (column AS VARCHAR2) and handling the variants within DataStage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply