Unhandled conversion error in modify stage.

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
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Unhandled conversion error in modify stage.

Post by videsh77 »

After I try to convert string format of date value to a date data type using modify stage, I get error below.

APT_CombinedOperatorController,2: Un-handled conversion error on field "JoiningDate " from source type "string" to destination type "date":
source value="16-12-2002"; the result is non-nullable and there is no handle_null to specify a default value.

Specification used in Modify stage is as below -
Joining_Date_Column:date=date_from_string(JoiningDate)

I am unable to get, where I have made a mistake. Can you please help me out to find out the problem?
Thanks with regards,
videsh.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

You have not specified your date format in the specification.

Code: Select all

Joining_Date_Column:date=date_from_string[%dd-%mm-%yyyy](JoiningDate) 
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Post by videsh77 »

Problem resolved. Thanks.
Thanks with regards,
videsh.
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Post by videsh77 »

My final intention is to get day of the year.

To achieve this I have converted String representation day into date format. Further I tried to get day of year by using 'year_day_from_date' function within same Modify stage.

For this I get runtime error. If I have to convert String format of a date to the day of the year, How I can do this?
Thanks with regards,
videsh.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Can you post your error message and your specification?
Also, Nested specification will not work in modify stage.
If you are working in datastage 7.5.1A version you can also consider to do this in transformer rather than modify stage
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Post by videsh77 »

Specification to convert string to int day of the year, is as below -

Joining_Day:int8=year_day_from_date(date_from_string[%dd-%mm-%yyyy](JoiningDate))

For this specification, I am getting following error.

main_program: Error parsing modify adapter: Error in binding: Error in source field selector: Expected integer, got: "%"
Expected destination field selector, got: ")"; input:
Joining_Date_Column:date=date_from_string[%dd-%mm-%yyyy](JoiningDate)
;
Joining_Day:int8=year_day_from_date(date_from_string[%dd-%mm-%yyyy](JoiningDate))


NOTE : If I convert string to date individually it is working fine.
Thanks with regards,
videsh.
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Post by videsh77 »

Can we have, two or more specifications together for the derivation of a single column, as described in my previous post?
Thanks with regards,
videsh.
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Post by videsh77 »

Can we have, two or more specifications together for the derivation of a single column, as described in my previous post?
Last edited by videsh77 on Mon Feb 05, 2007 4:57 am, edited 1 time in total.
Thanks with regards,
videsh.
videsh77
Premium Member
Premium Member
Posts: 97
Joined: Thu Dec 02, 2004 10:43 am
Contact:

Post by videsh77 »

Can we have, two or more specifications together for the derivation of a single column, as described in my previous post?
Thanks with regards,
videsh.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Read my previous post. I posted that nested specification is not available in modify stage.
One alternative would be to have two successive modify stages or use transformer.
Post Reply