how do i check for the last updated datetime in a job

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
bgs_vb
Premium Member
Premium Member
Posts: 79
Joined: Mon Jan 02, 2006 5:51 am

how do i check for the last updated datetime in a job

Post by bgs_vb »

Hi,

I need to check for last updated datetime of the table, for incremental upload.

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

Post by ray.wurlod »

You've got whatever the database provides, and anything you design into DataStage. Research.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bgs_vb
Premium Member
Premium Member
Posts: 79
Joined: Mon Jan 02, 2006 5:51 am

Post by bgs_vb »

I already have a job that checks using a routine the maxdatetime value, but it throws 'literal not in the format' error.

I tried like this :
say DtTime = '10-03-2006 08:15:25'
Dt = Left(Time, 10)
Tm = Right(DtTime, 12)
D1 = OCONV(ICONV(Dt, "D/DMY"), "D/MDY[2,2,4]")
T1 = OCONV(ICONV(Tm, "MTS"), "MTHS")

Ans = D1:" ":T1

when i test the output it from the routine it shows the date and time...but when i run it thru Director it throws error. also how do i initialize current server DateTime...is there any system variable available.

Advance thanks,

Vindy
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

Do you mean that you have last update time in the database and you want to use it to make the job incremental if yes then you can use it in the selection criteria ....
and if u mean that u want to assign the current run time information then you can use ds macros like DSJOBSTARTTIMESTAMP.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

bgs_vb wrote:...is there any system variable available.
Check the online Help index for System Variables - they are there. You'll find things like @DATE and @TIME plus references to functions like Date(), Time() and TimeDate() off the top of my head. See which would work best for you.
-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 »

bgs_vb wrote:I already have a job that checks using a routine the maxdatetime value, but it throws 'literal not in the format' error.

I tried like this :
say DtTime = '10-03-2006 08:15:25'
Dt = Left(Time, 10)
Tm = Right(DtTime, 12)
D1 = OCONV(ICONV(Dt, "D/DMY"), "D/MDY[2,2,4]")
T1 = OCONV(ICONV(Tm, "MTS"), "MTHS")

Ans = D1:" ":T1

when i test the output it from the routine it shows the date and time...but when i run it thru Director it throws error. also how do i initialize current server DateTime...is there any system variable available.

Advance thanks,

Vindy
Instead of Tm = Right(DtTime, 12) you need Tm = Right(DtTime, 8).
Only the rightmost 8 characters of the timestamp are the time component.
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