Can i get the max run date of Job

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
irajasekharhexa
Premium Member
Premium Member
Posts: 82
Joined: Fri Jun 03, 2005 5:23 am
Location: Bangalore
Contact:

Can i get the max run date of Job

Post 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
Rajasekhar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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
Mamu Kim
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
Post Reply