date function

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
femil
Participant
Posts: 27
Joined: Mon Nov 02, 2009 10:54 am
Location: chennai

date function

Post by femil »

what function is used to get the current date format of 'DD-MON-YY' in datastage transformer
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
femil
Participant
Posts: 27
Joined: Mon Nov 02, 2009 10:54 am
Location: chennai

thank you

Post by femil »

thank you and which gives the better performance field or conv function
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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?
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