Require assistance in conversion from string to date

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
creatingfusion
Participant
Posts: 46
Joined: Tue Jul 20, 2010 1:26 pm
Location: USA
Contact:

Require assistance in conversion from string to date

Post by creatingfusion »

I have a requirement where I have to get the value in the output field as '00000000' which is a date field. The requirement is to be done in the transformer and gets further into IDOC Sap Stage.

I tried the following function:
StringToDate("00000000","%yyyy%mm%dd")

It transforms and the output being "**********"

Please suggest some solution to this issue.

Thanks
ABhijit
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

"00000000" is not a valid date. That is why you see asterisks in your target. Assign default date if the input has "00000000"
You are the creator of your destiny - Swami Vivekananda
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

"00000000" is not a valid date (there is no year 0, there is no month 0, there is no day 0). So don't try to convert it.
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