Problem with StringtoDate function

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
reddy
Premium Member
Premium Member
Posts: 168
Joined: Tue Dec 07, 2004 12:54 pm

Problem with StringtoDate function

Post by reddy »

Hi All,

In my job i am using the transformer stage where I have used stage variables to implement logic. In that I have used StringToDate function to give the default date value for a date field . But the job is failing with following error.

APT_CombinedOperatorController,0: Operator terminated abnormally: Terminating with exception:APT_ParseError: Parsing parameters "YYYYMMDD" for conversion "date=date_from_string[%yyyy-%mm-%dd](string)": APT_Conversion_String_Date: Invalid Format [YYYYMMDD] used for string_from_date type conversion

and the syntax i have given is

StringToDate('9999-01-01','YYYY-MM-DD')

Any help is appreciated

Thanks in Advance
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I would think that

Code: Select all

String To Date('9999-01-01','%yyyy-%mm-%dd')
will make DS happier.
reddy
Premium Member
Premium Member
Posts: 168
Joined: Tue Dec 07, 2004 12:54 pm

Post by reddy »

Thanks Arndw ....That fixed my problem
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I would think that this would be more correcter:

Code: Select all

StringToDate('9999-01-01','%yyyy-%mm-%dd')
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply