Page 1 of 1

date function

Posted: Sat Nov 28, 2009 11:18 am
by femil
what function is used to get the current date format of 'DD-MON-YY' in datastage transformer

Posted: Sat Nov 28, 2009 11:49 am
by chulett
Two steps, actually. Date() or @DATE will get it in internal format then OConv() can convert it to any format. Or Field(TimeDate()," ",1,3) but you'll still need to 'adjust' the output.

thank you

Posted: Sat Nov 28, 2009 12:14 pm
by femil
thank you and which gives the better performance field or conv function

Posted: Sat Nov 28, 2009 12:20 pm
by chulett
Really shouldn't matter as you should do this in the Initial Value of a stage variable so it is only derived once. Unless you need to change the value when the job starts before but runs past midnight?

Posted: Sat Nov 28, 2009 3:53 pm
by ray.wurlod
@DATE gives the better performance, because it's set when the job starts and does not change thereafter. Date(), on the other hand, accesses the system clock to give the current date - which may be different than when the job started, particularly in an "always running" job. So what is it you are really after, performance or correctness?