issue in using date_from_string 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
HemaV
Participant
Posts: 63
Joined: Wed Jan 09, 2008 1:38 am
Location: Bangalore

issue in using date_from_string in modify stage

Post by HemaV »

Hi All,

i tried using date_from_string function in Modify stage:
My o/p column is date datatype in oracle db.

In modify stage i used new filed DT
DT:date=date_from_string("2013-04-04","yyyy-mm-dd")

I'm getting this below error:
main_program: Error parsing modify adapter: Error in binding: Expected source field selector; got: ""2013-04-04""
Expected destination field selector, got: ")"; input:
DT:date=date_from_string("2013-04-04","yyyy-mm-dd")

Could you please let me know how to resolve this date issue?

Thanks in Advance,
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The first argument of date_from_string must be the name of a column on the input link to the Modify stage. It cannot be a constant as you are trying to do.

Use an upstream Column Generator stage to generate the constant. Use a cycle with exactly one value.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
HemaV
Participant
Posts: 63
Joined: Wed Jan 09, 2008 1:38 am
Location: Bangalore

Post by HemaV »

I'm using in job parameter the column p_dt which is of string datatype and value we pass through sequencer as "2013-04-04".

DT:date=date_from_string(#p_dt#,"yyyy-mm-dd")

Can't i pass it as job parameter?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The first argument of date_from_string must be the name of a column on the input link.

Not a constant.

Not a job parameter.

Not anything else.
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