Page 1 of 1

Can i get the max run date of Job

Posted: Wed Apr 11, 2007 10:13 pm
by irajasekharhexa
Hi,

I was developed a job in server edition where i used to get the max date from the universe file by passing the Job name as the paramter.

i have imlimented some thing like

Max(upd_dt_time), and job name will be populated into the hashed file.

by using a routine i used to pass the job name as the parameter.
it suppose to give the max(upd_dt_time) as a return value.

Now my question is since we don't have the hashed file concept in EE.
Can i do the same in the EE as i explained above for server Jobs.

Thanks

Posted: Thu Apr 12, 2007 2:23 am
by ray.wurlod
There should be no problem generating the Max(upd_dt_time) from a parallel job. You can, indeed, still do this in a server job, and load the result into a hashed file, or the job's user status area. The job sequence can then read it from the hashed file or user status area and supply the value to the parallel job as a job parameter.

Posted: Thu Apr 12, 2007 6:57 am
by kduke
If anyone is using EtlStats then you can even do this in a shell script.

Code: Select all

LastRun=`$DSPath/dssh "LIST JobStatusLastRun '${RealJobName}' EVAL \"convert('-', '', field(@RECORD<4>, ' ', 1))\" ID.SUP COL-HDR-SUPP" | awk '{ if (NR==4) print $1 }'`
LastStat=`$DSPath/dssh "LIST JobStatusLastRun '${RealJobName}' EVAL \"@RECORD<2>\" ID.SUP COL-HDR-SUPP" | awk '{ if (NR==4) print $1 }'`
CurrentDate=$(/bin/date "+%Y%m%d")
if [ $LastRun -eq $CurrentDate ]
then
    if [ $LastStat -eq 0 -o $LastStat -eq 1 ]
    then
# -----------------------------------------------------------------
# True
# -----------------------------------------------------------------
        exit 0
    else
# -----------------------------------------------------------------
# False
# -----------------------------------------------------------------
        exit 1
    fi 
else
# -----------------------------------------------------------------
# Unknown
# -----------------------------------------------------------------
    exit 1
fi 
# -----------------------------------------------------------------
# Unknown
# -----------------------------------------------------------------
exit 1

Posted: Thu Apr 12, 2007 7:00 am
by kduke
You can use this logic to create solid restartability. I hope that is what you are doing here. If a job has been run successfully today then skip it or do not run it again.

I printed this shell script to give Craig some ideas on restartability within Control M.