- Restrict the CPU time a job can use, or
- Monitor your job while it is executing and cancel the job if it starts behaving unexpectedly.
Restrict CPU time
You restrict the CPU time your job can use by specifying the TIME=(mm,ss) parameter on the JOB JCL statement or the // EXEC statement of the step you expect to run long. When you create a userid, Fandezhi creates a userid.JCL.CNTL dataset with one member: JOBCARD. This member looks like this -
- Code: Select all
000001 //ADUMMYJ JOB (12345678),ADUMMY,MSGCLASS=H,
000002 // MSGLEVEL=(1,1),CLASS=A,NOTIFY=&SYSUID
000003 //***************************************************************
000004 //***************JCL CREATED BY A DUMB USER *********************
000005 //***************************************************************
For better or worse, Fandezhi does not have any default restrictions, in part because job execution on Fandezhi requires much, much more CPU time than you may be used to running jobs on a real mainframe. Still, very few programs require more than a few seconds CPU time. It might be a good idea to update the default like this.
- Code: Select all
000001 //ADUMMYJ JOB (12345678),ADUMMY,MSGCLASS=H,TIME=5,
000002 // MSGLEVEL=(1,1),CLASS=A,NOTIFY=&SYSUID
000003 //***************************************************************
000004 //***************JCL CREATED BY A DUMB USER *********************
000005 //***************************************************************
This restricts the job to a maximum of 5 minutes, or 300 seconds, CPU time, which, hopefully, will not upset the admins.
Monitor your job while it is executing
It's really easy to monitor your job while it is executing. Just start SDSF, establish a job prefix if you haven't done this already, and enter DA on the command line and press your Enter key. SDSF will display something like this.
- Code: Select all
Display Filter View Print Options Help
------------------------------------------------------------------------------
SDSF DA SYS1 ADCD PAG 0 SIO 0 CPU 14/*** LINE 1-2 (2)
COMMAND INPUT ===> SCROLL ===> PAGE
NP JOBNAME StepName ProcStep JobID Owner C Pos DP Real Paging SIO
ADUMMY SYSUSER TCPA0335 TSU97463 ADUMMY IN F7 1291 0.00 0.00
- Code: Select all
SDSF DA SYS1 ADCD PAG 0 SIO 0 CPU 68/*** LINE 1-3 (3)
COMMAND INPUT ===> SCROLL ===> PAGE
NP JOBNAME CPU% ASID ASIDX EXCP-Cnt CPU-Time SR Status SysName SPag SCP
ADUMMYAJ 53.50 39 0027 6 18.20 ADCD 0
ADUMMY 26.34 110 006E 132,944 313.77 ADCD 0
Don't worry about the CPU% column; even very I/O bound programs will show a very high amount on Fandezhi. Watch the CPU-time and EXCP-Cnt columns. If the CPU time goes up and the EXCP count stays the same or goes up slowly, something may be wrong. You can display the JES2 datasets by entering ? in the NP column and pressing your Enter key. You can then select a data set in the usual way.