Best way to populate jobstart datetime to Oracle -DS Macro

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
satish_valavala
Participant
Posts: 123
Joined: Wed May 18, 2005 7:41 am
Location: USA

Best way to populate jobstart datetime to Oracle -DS Macro

Post by satish_valavala »

I need to populate job start date_time (YYYY-MM-DD HH24:MM:SS, but not micro secs) to one of my oracle table field (of Oracle Date data type).
We may use DS macros DSJobStartDate:" ": DSJobStartTime
Or we can substring Macro DSJobStartTimestamp to pick date_time.
My question is which the best/efficient way to do this and reason for it.
I appreciate for your response

Thanks
Satish
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Create a Stage Variable.
Put Macro(s) in the Initial Value field.
Leave the Derivation of the Stage Variable blank.
Use in your output link.
-craig

"You can never have too many knives" -- Logan Nine Fingers
satish_valavala
Participant
Posts: 123
Joined: Wed May 18, 2005 7:41 am
Location: USA

Post by satish_valavala »

Thanks Craig Hulett. I am curious to know the reson for it.

Thanks
Regards
VS
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The date and time the job started doesn't change, so use the Initial Value of the stage variable to capture it once instead of on each row. The blank derivation of the stage variable means it retains its value over the course of the job. Then you just simply reference this value for each row going into Oracle.

Fast. :wink:
-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 »

Rather than the separate macros, why not use for stage variable initialization

Code: Select all

DSGetJobInfo(DSJ.ME, DSJ.JOBSTARTTIMESTAMP) 
(There may even be a DSJobStartTimeStamp macro - I don't have access to DataStage right now.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes, there is a DSJobStartTimestamp macro: "date and time when the job started on the server in the form YYYY-MM-DD HH:MM:SS".
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply