On Tue, 1 Feb 2011 11:52:38 +0100, Manfred Lotz
<[email protected]> wrote:

>Hi there,
>I have an existing JES2 exit06 and like to restrict time based on jobclass.
>
>Let us say I have a job class z where the maximum allowed time is 9
>minutes. I check for time= in job card and if the time parameter is
>set, and has anything greater than 9 minutes I would like to limit the
>job to 9 minutes as this is the policy for that particular job class.
>
>What is the correct field to set to get this done? I found JCTETIME in
>the JCT but I'm actually not quite sure if this is the one to use.
>

I did it in exit 6 in the past (you probably have seen posts of mine if
you checked the archives).  

When I wrote this exit, we only cared if people were using TIME=
with class "Q", which was an express class with 3 seconds of CPU 
time max.  There were always enough class Q inits since they were
for quick compiles, iebgener jobs, etc.     So I checked for time= 
and set a flag, then did a second check after all JCL was converted
to see if the jobclass was Q and time= was used.  If so, I set RC=8 
and canceled the job.   I also used the same exit to make RACF calls
to JOBCLASS.x in a locally defined RACF class to see if the user
was allowed to run in that class (keep test jobs out of production
classes). 

Here is a snippet of code which shows the internal text keys I 
checked (this was under MVS/XA, but this stuff hasn't changed):

***********************************************************************
*        THE TEXT OF THE EXEC CARD TEXT IS AS FOLLOWS                 *
*            1)  2 BYTE LENGTH OF TEXT STRING INCLUDING ITSELF        *
*            2)  1 BYTE INDICATOR COMMON TO ALL TEXT RECORDS          *
*            3)  1 BYTE OF MISCELLANEOUS INDICATORS                   *
*            4)  1 BYTE INDICATOR X'94' INDICATING EXEC POS INFORMATN *
*            5)  1 BYTE NUMBER OF EXEC POSITIONAL PARAMETERS          *
*                THE 1ST POS PARAMETER IS THE STEP NAME               *
*            6)  VARIABLE LENGTH LIST OF EXEC POS PARAMETERS          *
*                EACH PRECEDED BY A 1 BYTE LENGTH FIELD               *
*            7)  VARIABLE LENGTH LIST OF KEYWORD PARAMETERS           *
*                EACH IS PRECEDED BY A 1 BYTE KEY, 1 BYTE NUMBER OF   *
*                POSITIONAL SUBPARAMETERS PRESENT, AND A LIST OF      *
*                SUBPARAMETERS EACH PRECEDED BY A 1 BYTE LENGTH FIELD *
*                WHICH MAY BE ZERO IF OMITTED AND FOLLOWED BY ANOTHER *
*                POSITIONAL PARAMETER.                                *
*                                                                     *
*  MVS C/I TEXT FORMATS CAN BE FOUND IN :                             *
*  MVS/XA SPL USER EXITS APPENDIX A (GC28-1147-3 - TNL GN28-1201)     *
*                                                                     *
***********************************************************************
         LA    R2,STREKEY         POINT PAST EXEC TEXT STRING PREFIX   
         ST    R2,TEXTADDR        STORE START OF EXEC TEXT STRING      
*********************************************************************  
* CHECK EXEC STATMENT FOR USAGE OF TIME PARAMETERS                     
*********************************************************************  
CHKEXEC  CLI   0(R2),ENDK         END OF INTERNAL TEXT IMAGE?          
         BE    RETURN0            YES, DONE WITH THIS TEXT,  GET OUT   
         CLI   0(R2),TIMEEEK      EXEC "TIME=" KEY (X'93')             
         BNE   CHKTIME2           NO, BRANCH FOR SECOND CHECK          
         CLC   3(4,R2),=C'0000'   CHECK FOR STEP DEFAULT               
         BNE   NOTDEFLT              TIME=(0000,03) FROM               
         CLC   8(2,R2),=C'03'           JES2 PARMS JOBCLASS(Q)         
         BE    RETURN0            TIME OK, DONE WITH THIS TEXT-GET OUT 
NOTDEFLT MVI   TIMEFLAG,C'Y'      CHG TIME USAGE FLAG IN WKAREA TO 'Y' 
         B     RETURN0            DONE WITH THIS TEXT, GET OUT         
CHKTIME2 CLI   0(R2),TIMEPEK      EXEC "TIME." JCLOVRD KEY (X'8F')     
         BNE   EXLOOP             NO, GO FIND TO NEXT KEYWORD          
         MVI   TIMEFLAG,C'Y'      CHG TIME USAGE FLAG IN WKAREA TO 'Y' 
         B     RETURN0            DONE WITH THIS TEXT, GET OUT         



--
Mark Zelden - Zelden Consulting Services - z/OS, OS/390 and MVS       
mailto:[email protected]                                          
Mark's MVS Utilities: http://home.flash.net/~mzelden/mvsutil.html 
Systems Programming expert at http://expertanswercenter.techtarget.com/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to