People type TYPERUN. The keyword on the JOB statement is TYPRUN, with no second E. It is optional, and you code it once, next to CLASS or MSGCLASS. JES uses it when the job should not start the moment an initiator is free. The values are SCAN, HOLD, JCLHOLD, and COPY.
You hand in a worksheet. SCAN means the teacher checks the spelling and does not start the work. HOLD means the worksheet is finished and sitting on the counter until someone says go. JCLHOLD means it is still in the in-tray, so you can cross out a word before anyone copies it into the system. COPY means they file a photocopy and never do the work.
TYPRUN belongs on the JOB statement. It is not an EXEC parameter and it is not a DD parameter. Started tasks do not support it. IBM says that if TYPRUN is specified on a started task, the job fails. It is also not used for APPC scheduling.
1//PAYSCAN JOB (ACCT),'PAY SCAN',CLASS=A,MSGCLASS=H,TYPRUN=SCAN
The parameter name is TYPRUN in every example below. If a shop standard or an old deck still says TYPERUN, the converter will reject it as an unknown keyword.
| Value | JES | What JES does |
|---|---|---|
| SCAN | JES2 and JES3 | The converter checks the JCL. The job does not execute. Programs do not run, and steps do not allocate data sets. |
| HOLD | JES2 and JES3 | JES converts the JCL, then holds the job. An operator or an SDSF user releases it. After the release, the job runs. |
| JCLHOLD | JES2 only | JES2 holds the job before JCL processing finishes, so the submitted JCL can still be changed. If error messages are already pending, JES2 does not hold it. It finishes JCL processing and puts the job on the output queue. |
| COPY | JES2 only | JES2 copies the submitted job to output and does not execute it. This is not a syntax check. |
Use SCAN when the JCL is new, or when you changed a procedure, a symbolic, or a continuation, and you want the converter messages before anything allocates. Submit the job with TYPRUN=SCAN. Read JESJCL and JESYSMSG. Keyword spelling, bad parentheses, and many procedure problems show up there. Then take TYPRUN off the JOB statement, or you will keep scanning a job that never runs.
123//PAYSCAN JOB (ACCT),'PAY SCAN',CLASS=A,MSGCLASS=H,TYPRUN=SCAN //STEP1 EXEC PGM=PAYMASTR //PAYFILE DD DSN=PAY.MASTER,DISP=SHR
SCAN does not run PAYMASTR. It does not tell you the program will accept the PARM, that PAY.MASTER is on the volume the catalog claims, or that the step will end with return code 0. A clean scan means the JCL the converter saw was acceptable. Run the job in a test class after that.
Leave SCAN off production schedulers. A nightly job with TYPRUN=SCAN sits on the output queue and never updates the files.
Use HOLD when the JCL is already good and a person should choose the minute it runs. A tape that is not mounted, a batch that must follow a job the operator will release, a change window that has not opened yet. JES converts the job, then holds it. In SDSF the job is held. Release it with the A action, or with the JES2 command below. On JES3 the operator releases it with a modify command.
123//PAYHOLD JOB (ACCT),'PAY HOLD',CLASS=A,MSGCLASS=H,TYPRUN=HOLD //STEP1 EXEC PGM=PAYMASTR //PAYFILE DD DSN=PAY.MASTER,DISP=OLD
1$A PAYHOLD
Because conversion is already done, you do not rewrite that held job the way you rewrite a JCLHOLD job. If the data set name is wrong, cancel it and submit a corrected deck. Held jobs stay on the queue until someone releases or cancels them. A forgotten HOLD job is still using a queue slot tomorrow.
JCLHOLD is JES2 only. Use it when operations may need to edit the job before conversion. The input is still the JCL you submitted. In SDSF you can change a class, a data set name, or a step, then release the job. JES2 converts it and runs it.
123//PAYJCL JOB (ACCT),'PAY EDIT',CLASS=A,MSGCLASS=H,TYPRUN=JCLHOLD //STEP1 EXEC PGM=PAYMASTR //PAYFILE DD DSN=PAY.MASTER,DISP=SHR
Do not use JCLHOLD as a syntax check. IBM's JCL reference says JES2 holds the job before JCL processing finishes, until the operator releases it. If error messages are already pending, the job is not held. JES2 finishes JCL processing and puts it on the output queue. A job full of converter errors will not sit quietly waiting for you to fix it.
JES3 does not accept JCLHOLD or COPY. On JES3, TYPRUN=HOLD holds the job, and HOLD=YES on //*MAIN does the same kind of wait for an operator.
| Question | TYPRUN=HOLD | TYPRUN=JCLHOLD |
|---|---|---|
| When it holds | After conversion, before execution | Before JCL processing finishes |
| Can you still edit the JCL? | Not the converted job. Cancel it and submit a new one. | Yes. The input is still the JCL you submitted. Change it in SDSF, then release. |
| Which JES | JES2 and JES3 | JES2 only. On JES3, use TYPRUN=HOLD or HOLD=YES on //*MAIN. |
| If the JCL is already wrong | Conversion messages are in the output. The job still sits held if conversion completed. | If those messages are already pending, JES2 skips the hold and sends the job to output. |
COPY is JES2 only. JES2 writes the submitted job to output and does not execute it. Use it when you want that copy of the input, not when you want syntax messages. For messages, code SCAN. A program that should run, even a program as small as IEFBR14, needs neither COPY nor SCAN.
1//PAYCOPY JOB (ACCT),'PAY COPY',CLASS=A,MSGCLASS=H,TYPRUN=COPY
A HOLD job executes when it is released. A JCLHOLD job on JES2 is converted after the release, then it executes, unless the converter finds errors and sends it to output instead.
You changed the PAYMASTR procedure and you do not want STEP1 to allocate PAY.MASTER. Add TYPRUN=SCAN to the JOB statement, submit it, and read JESYSMSG. If the converter is clean, remove TYPRUN and submit again in a test class. If you leave SCAN on, the second submit still will not run PAYMASTR.
Operations calls and says they will change the input data set name after you submit, before the job is converted. The system is JES2. Code TYPRUN=JCLHOLD. If they only need to wait until midnight and the JCL is already correct, code TYPRUN=HOLD instead. JCLHOLD on JES3 will fail. Use HOLD there.
A production member still has TYPRUN=SCAN from the day it was written. The job "succeeds" every night and the files never change. Delete the parameter and confirm the next run shows an executing step, not only converter output.
1. Which TYPRUN value checks the JCL and does not run the job?
2. You need to change a data set name after submit, before JES converts the job, on JES2. Which value do you code?
3. The job is already converted. It should sit until the night operator releases it. Which value do you code?
4. Which values are JES2 only?
TYPERUN is the spelling people type. The JOB statement parameter is TYPRUN. It tells JES to scan the JCL, hold the job, or copy it to output, instead of running it as soon as an initiator is free. The values are SCAN, HOLD, JCLHOLD, and COPY.
TYPRUN=SCAN asks JES to check the JCL for syntax errors and not execute the job. You get converter messages in the job output. SCAN does not run the program, and it does not prove that a data set exists at execution time or that the program will end with a clean return code.
TYPRUN=HOLD converts the JCL, then holds the job until someone releases it. TYPRUN=JCLHOLD is JES2 only. JES2 holds the job before JCL processing finishes, so you can still change the JCL. If error messages are already pending, JCLHOLD does not hold the job. It finishes JCL processing and places the job on the output queue.
No. JCLHOLD and COPY are JES2 only. On JES3, TYPRUN=HOLD holds the job until an operator releases it. JES3 can also hold a job with HOLD=YES on the //*MAIN statement.
On JES2, release it in SDSF with the A action, or with the command $A jobname. On JES3, the operator releases it with a modify command such as *F J=jobnumber,R. After the release, a HOLD job executes. A JCLHOLD job on JES2 is converted and then executed.
Where TYPRUN is coded, with the job name, accounting information, and CLASS.
CLASS, MSGCLASS, MSGLEVEL, and the other keywords that sit beside TYPRUN.
TYPRUN next to PRTY, RESTART, NOTIFY, and the security keywords.
Where you see a held job and release it with the A action.