Current TimeStamp as parameter

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
vputta
Premium Member
Premium Member
Posts: 47
Joined: Wed Oct 08, 2008 7:35 am
Location: Charlotte

Current TimeStamp as parameter

Post by vputta »

Hi ,

I need to pass Current Timestamp as a parameter to the DS job .
But i am having problem to execute the below code in Job control of the DS job .

--------------------------------------------------------------------------------------
$INCLUDE DSINCLUDE JOBCONTROL.H



Job_Handle=DSJ.ME
JobName=DSGetJobInfo(Job_Handle,DSJ.JOBNAME)

StartTimeStmp = DSGetJobInfo(Job_Handle,DSJ.JOBSTARTTIMESTAMP)

ErrCode = DSSetParam(Job_Handle,"Maint_Date", StartTimeStmp)

return

--------------------------------------------------------------------------------------

Plz suggest ..

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

Post by ray.wurlod »

It is not possible to set a job parameter value once the job is running.
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 »

To use the "timestamp when the job started" in the job itself, use the DSJobStartTimestamp macro rather than a job parameter.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vputta
Premium Member
Premium Member
Posts: 47
Joined: Wed Oct 08, 2008 7:35 am
Location: Charlotte

Post by vputta »

I need to use this timestamp parameter in the output sequential file name .
I guess we can do this only through Job execution code .
Plz suggest

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

Post by chulett »

So then it does need to be a job parameter. Pass it in (properly formatted) via a Sequence job. As noted, "Job Control" code runs after the job has started where it is too late to set parameters.
-craig

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