How to get previous timestamp field

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
monaz
Participant
Posts: 98
Joined: Sat Aug 23, 2008 3:14 am

How to get previous timestamp field

Post by monaz »

Hi all is there any way which i can get previous timepstamp for the field.

Example In a table i have a field Last_upt_tmpst with this field i need to put constraint in my job as last_upt_tmpst> @previous_upt_tmpst

But i dont want to declare variable as @previous_upt_tmpst..

Is there any way which i can get by any Convert function.

Please help me on this.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use stage variables to "remember" the previous value (that is, the value in the previous row). What does "previous" actually mean in your context?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
monaz
Participant
Posts: 98
Joined: Sat Aug 23, 2008 3:14 am

Post by monaz »

for example i am running a job(25th) and i need to extract data of 24th from the table AB with field lst_updt is a timestamp field.

How can i proceed with this
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

So you need the equivalent of the timestamp of this time on the previous day to a particular timestamp? Download the routines from this site and you will find one (AddDaysToTimestamp) that does timestamp arithmetic. Use -1 as the Days argument.
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 »

Sounds like you need to create a job to capture this 'lst_updt' and stash it somewhere like USERSTATUS. Then use a Sequence job to run the two Server jobs and pass it as a Job Parameter to the second job. Use the job parameter in the constraint.
-craig

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