JOB Statement
Enhanced Definition
Key Characteristics
- * Must be first statement in job (after comments) * Assigns unique jobname (1-8 characters) * Provides accounting and identification * Specifies job-level parameters * Controls job execution characteristics * Required for all batch jobs * Establishes job security context
-
Basic Syntax:
-
Minimal JOB Statement:
jcl //JOBNAME JOB -
Standard Format:
jcl //jobname JOB (accounting-info),'programmer-name', // keyword-parameters -
Complete Example:
jcl //PAYROLL JOB (ACCT1234,PROJ-A),'JOHN DOE', // CLASS=A, // MSGCLASS=X, // MSGLEVEL=(1,1), // NOTIFY=&SYSUID, // REGION=4M, // TIME=(,30) -
Jobname Rules:
-
Naming Conventions:* 1-8 characters maximum * Must start with alphabetic (A-Z) or national (@, #, $) * Remaining characters: alphanumeric or national * No special characters or spaces * Must be unique in the system
-
Examples:
jcl //PROD001 JOB ... Valid //PAY2024 JOB ... Valid //@MONTHLY JOB ... Valid (starts with @) //TEST#123 JOB ... Valid (# is national) //1STRUN JOB ... Invalid (starts with number) //MY-JOB JOB ... Invalid (hyphen not allowed) //TOOLONGNAME JOB ... Invalid (9 characters) -
Accounting Information:
-
Format:
jcl //JOBNAME JOB (account,additional-info),'programmer' -
Single Account:
jcl //JOB1 JOB (DEPT123),'DEVELOPER' -
Multiple Accounting Fields:
jcl //JOB2 JOB (ACCT,PROJECT,ROOM,TIME),'PROGRAMMER' -
With Chargeback:
jcl //BILLING JOB (FIN001,'PROJECT-X','COST-CENTER-500'), // 'FINANCE TEAM' -
Programmer Name Field:
-
Basic Format:
jcl //JOBNAME JOB (ACCT),'John Doe' -
Rules:* Enclosed in apostrophes * Maximum 20 characters * Can include spaces * Special characters allowed within quotes * Used for identification and notifications
-
Examples:
jcl //JOB1 JOB (123),'Smith, J.' //JOB2 JOB (456),'Development Team' //JOB3 JOB (789),'O''Brien' O'Brien (doubled apostrophe) -
CLASS Parameter:* Assigns job to execution class * Controls scheduling priority * Format: CLASS=x (A-Z, 0-9)
jcl //PRODRUN JOB (ACCT),'PROGRAMMER', // CLASS=A Production class //TESTRUN JOB (ACCT),'DEVELOPER', // CLASS=T Test class -
MSGCLASS Parameter:* Directs system messages and JCL listing * Specifies output class * Format: MSGCLASS=x
jcl //JOB1 JOB (ACCT),'USER', // MSGCLASS=X Hold for viewing //JOB2 JOB (ACCT),'USER', // MSGCLASS=A Print immediately -
MSGLEVEL Parameter:* Controls JCL and allocation messages * Format: MSGLEVEL=(statements,messages) * statements: 0, 1, or 2 * messages: 0 or 1
jcl //JOB1 JOB (ACCT),'USER', // MSGLEVEL=(1,1) JCL listing + all messages //JOB2 JOB (ACCT),'USER', // MSGLEVEL=(0,0) Minimal messages //JOB3 JOB (ACCT),'USER', // MSGLEVEL=(2,1) JCL + procedures + all messages -
Values Explained:* MSGLEVEL=(0,x): JCL statements only if error * MSGLEVEL=(1,x): Input JCL statements only * MSGLEVEL=(2,x): Input JCL + cataloged procedures * MSGLEVEL=(x,0): Allocation messages only if error * MSGLEVEL=(x,1): All allocation messages
-
NOTIFY Parameter:* Sends TSO message when job completes * Format: NOTIFY=userid or NOTIFY=&SYSUID
jcl //JOB1 JOB (ACCT),'USER', // NOTIFY=USERID1 Notify specific user //JOB2 JOB (ACCT),'USER', // NOTIFY=&SYSUID Notify submitter -
REGION Parameter:* Specifies memory allocation * Format: REGION=nnnK or REGION=nnnM * Default varies by installation
jcl //SMALLJOB JOB (ACCT),'USER', // REGION=2M 2 megabytes //BIGJOB JOB (ACCT),'USER', // REGION=128M 128 megabytes //MAXJOB JOB (ACCT),'USER', // REGION=0M Maximum available -
TIME Parameter:* CPU time limit for entire job * Format: TIME=(minutes,seconds) or TIME=minutes * Prevents runaway jobs
jcl //QUICKJOB JOB (ACCT),'USER', // TIME=(,30) 30 seconds //NORMALJB JOB (ACCT),'USER', // TIME=(5,0) 5 minutes //LONGJOB JOB (ACCT),'USER', // TIME=60 60 minutes //NOLIMIT JOB (ACCT),'USER', // TIME=1440 24 hours (max typical) -
PRTY Parameter:* Job priority within class * Range: 0-15 (15=highest) * Works with job class
jcl //HIGHJOB JOB (ACCT),'USER', // CLASS=A, // PRTY=15 Highest priority //LOWJOB JOB (ACCT),'USER', // CLASS=B, // PRTY=5 Lower priority -
TYPRUN Parameter:* Special job processing * Values: SCAN, HOLD, COPY, JCLHOLD
jcl //SYNTAXCK JOB (ACCT),'USER', // TYPRUN=SCAN Check syntax only //HOLDJOB JOB (ACCT),'USER', // TYPRUN=HOLD Submit but hold //COPYJCL JOB (ACCT),'USER', // TYPRUN=COPY Copy to output only -
COND Parameter (Job-Level):* Applies to all job steps * Format: COND=(code,operator)
jcl //CAUTIOUS JOB (ACCT),'USER', // COND=(0,NE) Stop if any RC≠0 //TOLERANT JOB (ACCT),'USER', // COND=(8,LT) Stop if any RC<8 -
USER Parameter:* Specifies security userid * Overrides submitter's userid * Requires proper authority
jcl //SPECIAL JOB (ACCT),'ADMIN', // USER=PRODID Run as PRODID -
PASSWORD Parameter:* Job password (legacy) * Rarely used in modern systems
jcl //SECURED JOB (ACCT),'USER', // PASSWORD=secret -
GROUP and SECLABEL Parameters:* RACF security controls * Specify security classifications
jcl //SECURED JOB (ACCT),'USER', // GROUP=PRODGRP, // SECLABEL=CONFIDENT -
RESTART Parameter:* Restart job from specific step * Used for job recovery
jcl //RESTARTJ JOB (ACCT),'USER', // RESTART=STEP3 Restart at STEP3 //CKPTREST JOB (ACCT),'USER', // RESTART=(STEP2,CKPT4) Restart from checkpoint -
PERFORM Parameter:* WLM performance group * Assigns service class
jcl //WLMJOB JOB (ACCT),'USER', // PERFORM=5 Performance group 5 -
Complete JOB Statement Examples:
-
Production Job:
jcl //PROD001 JOB (FINANCE,'MONTH-END','ACCT-5000'), // 'ACCOUNTING SYSTEM', // CLASS=A, // MSGCLASS=X, // MSGLEVEL=(1,1), // NOTIFY=&SYSUID, // REGION=64M, // TIME=(30,0), // PRTY=14 -
Test/Development Job:
jcl //TEST123 JOB (DEVACCT,'PROJECT-A'),'J. Developer', // CLASS=T, // MSGCLASS=H, // MSGLEVEL=(2,1), // NOTIFY=&SYSUID, // REGION=8M, // TIME=(,30), // TYPRUN=SCAN -
Long-Running Batch:
jcl //NIGHTLY JOB (BATCH001,'EOD-PROCESS'),'BATCH SYSTEM', // CLASS=L, // MSGCLASS=A, // MSGLEVEL=(1,1), // NOTIFY=OPERATOR, // REGION=0M, // TIME=1440, // PRTY=12, // PERFORM=1 -
Secure Production Job:
jcl //PAYROLL JOB (HR0001,'PAYROLL','WEEKLY'), // 'PAYROLL PROCESSING', // CLASS=A, // MSGCLASS=X, // MSGLEVEL=(1,1), // USER=PAYID, // GROUP=HRGROUP, // NOTIFY=&SYSUID, // REGION=128M, // TIME=(60,0), // PRTY=15 -
JOB Statement Continuation:
-
Continuation Rules:* Break after comma * Continue on next line with // in columns 1-2 * Continue parameter coding after // * Can span multiple lines
-
Example:
jcl //LONGNAME JOB (ACCOUNTING,PROJECT,DEPARTMENT), // 'Very Long Programmer Name Here', // CLASS=A, // MSGCLASS=X, // MSGLEVEL=(1,1), // NOTIFY=&SYSUID, // REGION=64M, // TIME=(30,0), // PRTY=10, // TYPRUN=HOLD -
JOB Statement Validation:
-
Syntax Checking:
jcl //TESTJOB JOB (ACCT),'USER', // TYPRUN=SCAN Only check syntax - * Missing comma between parameters * Invalid parameter values * Improperly quoted strings * Missing apostrophe closure * Invalid jobname format * Missing required fields
-
Error Messages:
IEF653I SUBSTITUTION JCL - jobname JCL ERROR - indicates specific problem HASP250 jobname IS PURGED - rejected by JES - Security Considerations:S
-
RACF Integration:* Jobname checked against RACF profiles * USER parameter requires SUBMIT authority * Password validation (if used) * Group and security label verification * Accounting field validation
-
Best Security Practices:* Use GROUP parameter for shared IDs * Implement SECLABEL for classified data * Avoid PASSWORD parameter * Use RACF profiles for job authorization * Audit job submissions * Restrict TYPRUN=COPY usage
-
Job Submission Methods:
-
Internal Reader:
jcl //SUBMIT EXEC PGM=IEBGENER //SYSUT1 DD * //JOBNAME JOB (ACCT),'USER' //STEP1 EXEC PGM=PROG /* //SYSUT2 DD SYSOUT=(A,INTRDR) //SYSIN DD DUMMY -
TSO SUBMIT Command:
SUBMIT 'MY.JCL.LIB(JOBNAME)' -
Automated Schedulers:* CA-7 * Control-M * TWS (Tivoli Workload Scheduler)
-
SDSF Submission:* Edit JCL in SDSF * Use SUBMIT command * View in input queue
-
Job Tracking and Monitoring:
-
JES Job Number:* Assigned when job submitted * Format: JOBnnnnn or Jnnnnnnn * Unique identifier for tracking
-
Job Status Commands:
Display jobs: $DJ Display specific job: $DJ jobname Hold job: $HJ jobname Release job: $AJ jobname Cancel job: $CJ jobname Purge job: $PJ jobname -
SDSF Commands:
ST Status of jobs DA Display active jobs H Hold jobs O View output ? Filter display - Performance and Monitoring:S
-
SMF Records:* Type 30 records generated * Job start time * Job end time * CPU time used * I/O operations * Memory usage * Job completion code
-
Accounting Reports:* Resource consumption by job * Chargeback information * Job statistics * Performance metrics * Trend analysis
-
Best Practices:
-
Naming Conventions:* Use meaningful jobnames * Follow site standards * Include date or sequence numbers * Identify application or system * Use consistent patterns
-
Documentation:* Complete programmer name * Descriptive accounting info * Comment job purpose * Document special requirements * Note scheduling constraints
-
Resource Management:* Appropriate CLASS assignment * Realistic TIME limits * Proper REGION sizing * Correct PRTY settings * Use NOTIFY for important jobs
-
Error Prevention:* Use TYPRUN=SCAN for testing * Verify security authorizations * Check dataset availability * Validate parameter values * Test in non-production first
-
Operational Efficiency:* Use appropriate MSGCLASS * Set MSGLEVEL wisely * Consider PERFORM groups * Plan for restart capability * Document dependencies
- Troubleshooting:S
-
Job Not Submitting:* Check JCL syntax * Verify security authorization * Check accounting field format * Verify jobname uniqueness * Review system messages
-
Job Held in Queue:* Check TYPRUN parameter * Verify CLASS availability * Check resource requirements * Review scheduling conflicts * Examine initiator status
- * JCL ERROR: Syntax problem * IEF653I: Substitution occurred * IEF142I: Invalid parameter * IEF450I: JOB statement missing * HASP250: Job purged
-
Diagnostic Steps:1. Review JES messages 2. Check system log 3. Verify security authorization 4. Examine JCL syntax 5. Test with TYPRUN=SCAN 6. Check resource availability
Use Cases
-
Production Processing:* Daily business batch jobs * End-of-day processing * Month-end procedures * Payroll processing * Report generation
-
Development and Testing:* Program compilation jobs * Unit testing * Integration testing * Performance testing * Code deployment
-
System Administration:* Backup procedures * File maintenance * Database reorganization * System monitoring * Cleanup jobs
-
Data Management:* ETL processes * Data migration * Archive procedures * Data quality jobs * Report distribution
Related Concepts
Closely Related:
* JCL: JOB statement is part of JCL
* Job: Entity defined by JOB statement
* Job Class: Specified by CLASS parameter
* Job Step: Follows JOB statement
* EXEC Statement: Defines steps within jobSupporting Concepts:
* JES2/JES3: Processes JOB statement
* RACF: Security validation
* SMF: Records job accounting
* Accounting: Uses JOB parameters
* Scheduling: Based on JOB parametersManagement Concepts:
* WLM: Uses PERFORM parameter
* Initiator: Selects jobs by CLASS
* Operator: Manages job execution
* SDSF: Displays job status