Date Conversions

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
iamnagus
Participant
Posts: 48
Joined: Wed Sep 29, 2004 1:16 am

Date Conversions

Post by iamnagus »

I want to convert the date format dd-mm-yyyy to mm-dd-yy in transformer stage, but it only displaying in yyyy-mm-dd.

(I read the source date format as char from sequential file stage and now i am using StringToDate function to convert into mm-dd-yy. I am getting
yyy-mm-dd only it targer and it also some times viewing as ********** when i tried to view ny dataset management facility).

can any one help for this?
naveen19
Participant
Posts: 52
Joined: Tue Mar 06, 2007 9:08 am
Location: India
Contact:

Re: Date Conversions

Post by naveen19 »

iamnagus wrote:I want to convert the date format dd-mm-yyyy to mm-dd-yy in transformer stage, but it only displaying in yyyy-mm-dd.

(I read the source date format as char from sequential file stage and now i am using StringToDate function to convert into mm-dd-yy. I am getting
yyy-mm-dd only it targer and it also some times viewing as ********** when i tried to view ny dataset management facility).

can any one help for this?
Hi,

U can use this function in the transformer

Field(DSLink3.Date,'-',2) :'-' : Field(DSLink3.Date,'-',1) :'-':Right(DSLink3.Date,4)

. use this function stage variable and then use that in derivation part

Date: column name
source/target metadata: varchar

Regards
Naveen.K
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What is the format of the data in the character string that you are reading? Use this as the format string in a StringToDate() function. Use that result in a DateToString() function, this time specifying the desired output format. The function calls may be nested.
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