About 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
BCAPP
Participant
Posts: 7
Joined: Tue Aug 02, 2005 9:29 am

About Modify Stage

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard! :D
Please post the entire error/warning message.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
BCAPP
Participant
Posts: 7
Joined: Tue Aug 02, 2005 9:29 am

Post 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
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Did you try %yyyy-%mm-%dd?
BCAPP
Participant
Posts: 7
Joined: Tue Aug 02, 2005 9:29 am

Post by BCAPP »

Hi,


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


Thanks,
Bhavna
dsusr
Premium Member
Premium Member
Posts: 104
Joined: Sat Sep 03, 2005 11:30 pm

Post 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
Post Reply