Page 1 of 1

About Modify Stage

Posted: Fri Sep 16, 2005 3:48 am
by BCAPP
Hi,

I need to convert the date which is in the form 20050202 to 2005-02-02.
I tried using the Modify stage in order to acheive this and gave the following derivation in the modify stage:LEAD_START_DATE=StringToDate(LEAD_START_DATE,"%yyyy%mm%dd")

Compilation was successful but the job aborted during run by giving the following message:

LEAD_START_DATE=StringToDate(LEAD_START_DATE,"%yyyy%mm%dd")

Is there anyother way to acheive this functionality in Modify Stage.
Please let me know


Thanks,
Bhavna

Posted: Fri Sep 16, 2005 3:54 am
by ray.wurlod
Welcome aboard! :D
Please post the entire error/warning message.

Posted: Fri Sep 16, 2005 4:30 am
by BCAPP
The entire error message is posted below:


main_program: Error parsing modify adapter: Error in binding: Unknown conversion: StringToDate; input:
(LEAD_START_DATE=StringToDate(LEAD_START_DATE,"%yyyy%mm%dd")
;



Also I tried using the date_from_string(string) function which converts the string to a date representation.
I gave the below specification:
LEAD_START_DATE=date_from_string(LEAD_START_DATE)

The job compiled and ran successfully but the value of the field is coming out to be NULL.Please let me know if i can use any other function to get the date in CCYY-MM-YY format.

Thanks,
Bhavna

Posted: Fri Sep 16, 2005 5:00 am
by Sainath.Srinivasan
Did you try %yyyy-%mm-%dd?

Posted: Fri Sep 16, 2005 7:08 am
by BCAPP
Hi,


I tried using %yyyy-%mm-%dd option but the job aborted while running.


Thanks,
Bhavna

Posted: Fri Sep 16, 2005 7:17 am
by dsusr
[quote="BCAPP"]
Also I tried using the date_from_string(string) function which converts the string to a date representation.
I gave the below specification:
LEAD_START_DATE=date_from_string(LEAD_START_DATE)

The job compiled and ran successfully but the value of the field is coming out to be NULL.Please let me know if i can use any other function to get the date in CCYY-MM-YY format.
[/quote]

Hi,

You cannot use all the transformer functions since modify operator doent support that. But you can use the date_from_string function with parameters.

In your example you can try date_from_string[%yyyy%mm%dd](LEAD_START_DATE)

Regards
dsusr