I need to capture average running time of jobs(~2 lakhs) using their latest five runs from SART. I have the code,
//UPDASYS EXEC PROC=SAS,REGION=0M,WORK='10,10'
//LIBRARY DD DISP=SHR,DSN=ITCX0$P.PB.MXG.PDB.FORMATS
//PDB1 DD DISP=SHR,DSN=ITCX0$P.PB.PDB.TREND.SYSE
//PDB2 DD DISP=SHR,DSN=ITCX0$P.PB.PDB.TREND.SYSF
//OUTFILE DD DSN=filename,
// DISP=(NEW,CATLG,DELETE),
// DATACLAS=LARGE,
// DCB=(RECFM=FB,LRECL=56)
//SASPRINT DD SYSOUT=*
//SYSIN DD *
OPTIONS PAGESIZE=MAX;
DATA PGMDTL (KEEP=JOB STARTDATE STARTTIME ENDDATE ENDTIME);
SET PDB1.TYPE30_5
PDB2.TYPE30_5;
/*** INLCUDE ALL YOUR JOBS HERE WITH OR CONDITIONS ***/
IF JOB = 'BCS10090'
OR JOB = 'BCS1ANIC'
OR JOB = 'BCS1ANIR'
.....
/* IF SUBSTR(JOB,1,3) NOT = 'ISD'; */
STARTDATE = DATEPART(JINITIME); FORMAT STARTDATE MMDDYY8.;
STARTTIME = TIMEPART(JINITIME); FORMAT STARTTIME TIME8.;
ENDDATE = DATEPART(JTRMTIME); FORMAT ENDDATE MMDDYY8.;
ENDTIME = TIMEPART(JTRMTIME); FORMAT ENDTIME TIME8.;
IF STARTDATE = '11AUG2007'D
OR STARTDATE = '12AUG2007'D
OR STARTDATE = '13AUG2007'D;
/*** YOU CAN ALSO SORT BY WHATEVER FIELD YOU WANT ***/
PROC SORT DATA=PGMDTL;
BY JOB STARTDATE STARTTIME ENDDATE ENDTIME;
RUN;
Instead of giving job names manually, i m extract all the job names in a file (created/extracted using SORT). Can anyone help me how shall i proceed further? or is there otherways to capture average running time of jobs from SART?
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
I can remember using PDB with the MXG product.
Code:
*** INLCUDE ALL YOUR JOBS HERE WITH OR CONDITIONS ***/
IF JOB = 'BCS10090'
OR JOB = 'BCS1ANIC'
OR JOB = 'BCS1ANIR'
Well, if you have a list of jobnames in another dataset, why not read them into a SAS dataset and do a MERGE against the PDB jobnames. Like this ....
Code:
DATA whatever;
MERGE pdbdata (IN=IN1)
other (IN=IN2);
BY whatever;
If IN1 & IN2;
Code:
/* IF SUBSTR(JOB,1,3) NOT = 'ISD'; */
STARTDATE = DATEPART(JINITIME); FORMAT STARTDATE MMDDYY8.;
STARTTIME = TIMEPART(JINITIME); FORMAT STARTTIME TIME8.;
ENDDATE = DATEPART(JTRMTIME); FORMAT ENDDATE MMDDYY8.;
ENDTIME = TIMEPART(JTRMTIME); FORMAT ENDTIME TIME8.;
IF STARTDATE = '11AUG2007'D
OR STARTDATE = '12AUG2007'D
OR STARTDATE = '13AUG2007'D;
I would probably use something like
Code:
/* IF SUBSTR(JOB,1,3) NOT = 'ISD'; */
STARTDATE = DATEPART(JINITIME); FORMAT STARTDATE MMDDYY8.;
IF STARTDATE GE '11AUG2007'D AND STARTDATE LE '13AUG2007'D;
STARTTIME = TIMEPART(JINITIME); FORMAT STARTTIME TIME8.;
ENDDATE = DATEPART(JTRMTIME); FORMAT ENDDATE MMDDYY8.;
ENDTIME = TIMEPART(JTRMTIME); FORMAT ENDTIME TIME8.;
That way you do a range check against the STARTDATE rather than comparing to every possibility.
Also, doing the check on STARTDATE before working on other variables, as shown above, you only perform work on the other variables when the data is valid rather than as default.
Another point, why format the data every time, why not set out the format once before the read ....
Code:
DATA whatever;
FORMAT datexxx DATE10.
timeyyy TIME8.;
SET indata;