Hi
I'm trying to create an sql to report on 2 tables where I have a max run time permitted for a job and the run history of a job. I want to identify all those jobs where the MAX of the run history is within 90% of the max run time permitted. Can anyone help me how I can do this, the SQL is below and works within Oracle (I'm more familiar with) but not on iSeries SQL. The OS is version 5 release 2.
SELECT job.JOBNAM, job.PROGDS, job.SCHOVR,
job.MAXRUN, job.RTMXRT Action_CD,
INT((max(hist.CMRTIM)/job.MAXRUN)*100)as MAXRUN_P,
min(hist.CMRTIM) MIN, max(hist.CMRTIM)as MAX,
INT(avg(hist.CMRTIM)) AVG,
count(hist.CMRNAM)No_RECS
FROM table1 job, table2 hist
where hist.CMRNAM=job.JOBNAM
AND job.JOBTYP <> 'G'
group by JOBNAM, job.PROGDS, job.SCHOVR, job.MAXRUN, job.RTMXRT
having INT((max(hist.CMRTIM)/job.MAXRUN)*100)>90
Thanks
Phil.
I'm trying to create an sql to report on 2 tables where I have a max run time permitted for a job and the run history of a job. I want to identify all those jobs where the MAX of the run history is within 90% of the max run time permitted. Can anyone help me how I can do this, the SQL is below and works within Oracle (I'm more familiar with) but not on iSeries SQL. The OS is version 5 release 2.
SELECT job.JOBNAM, job.PROGDS, job.SCHOVR,
job.MAXRUN, job.RTMXRT Action_CD,
INT((max(hist.CMRTIM)/job.MAXRUN)*100)as MAXRUN_P,
min(hist.CMRTIM) MIN, max(hist.CMRTIM)as MAX,
INT(avg(hist.CMRTIM)) AVG,
count(hist.CMRNAM)No_RECS
FROM table1 job, table2 hist
where hist.CMRNAM=job.JOBNAM
AND job.JOBTYP <> 'G'
group by JOBNAM, job.PROGDS, job.SCHOVR, job.MAXRUN, job.RTMXRT
having INT((max(hist.CMRTIM)/job.MAXRUN)*100)>90
Thanks
Phil.