TimeStamp with milliseconds in PX job

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
kalyang
Participant
Posts: 1
Joined: Wed Feb 22, 2006 9:21 pm

TimeStamp with milliseconds in PX job

Post by kalyang »

Hi There,

How do I get the current time with milliseconds and time zone in parallel job?

(i.e. format) yyyy-MM-dd HH:mm:ss.SSS zzz

where zzz is three dig Zone.

Kalyan.G
kalyan.G
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not asking for much, eh? Milliseconds and a timezone. :lol:

Check this post from our dear friend Arnd, it covers the milliseconds part and can probably be leveraged for both.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

There isnt any inbuilt funciton available for extracting TimeZone. You need to do workaroud to capture that. Else you can use D code, Iconv,Oconv from UserVariableActivity and pass on the value as a parameter. (If required as a single value as a whole for that job)
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can get the GMT time from the System() function, so presumably can get the offset via arithmetic. And, of course, you can get the time zone from the TZ environment variable.

In what format do you require this "timestamp"?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

May I know is TZ environmential variable for PX?
Also I guess System() function is not a PX funciton.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

TZ is a standard UNIX environment variable. You could therefore define it for PX with a default value of $ENV.
System() is a BASIC function. You could therefore create a routine to be invoked from a Routine activity in a job sequence.
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