PARM Parameter

Purpose

The PARM parameter passes information to a program when it begins execution. It allows you to provide runtime options, control flags, configuration settings, file names, or other parameters that influence how the program operates. The content and format of PARM data depends entirely on what the executing program expects and can interpret.

Syntax

jcl
1
2
3
//stepname EXEC PGM=program,PARM='parameter-string' //stepname EXEC PROC=procname,PARM='parameter-string' //stepname EXEC PROC=procname,PARM.procstep='parameter-string'

Alternate Syntax with Parameter Continuation

jcl
1
2
3
//stepname EXEC PGM=program, // PARM='long-parameter- // string-continued'

Format

The PARM parameter has the following characteristics:

  • Length Limit: Maximum 100 characters (or defined by installation)
  • Character Set: Alphanumeric and special characters
  • Delimiter Requirements: Must be enclosed in single quotes if it contains special characters or blanks
  • Special Characters: To include a single quote within PARM text, use two consecutive single quotes
  • Processing: Passed to the program in a parameter list address on entry

Accessing PARM Data in Programs

In COBOL:

cobol
1
2
3
4
5
6
7
8
9
LINKAGE SECTION. 01 PARM-DATA. 05 PARM-LENGTH PIC S9(4) COMP. 05 PARM-TEXT PIC X(100). PROCEDURE DIVISION USING PARM-DATA. IF PARM-LENGTH > 0 DISPLAY 'Parameter received: ' PARM-TEXT(1:PARM-LENGTH) END-IF.

In Assembler:

plaintext
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
MYPROG CSECT SAVE (14,12) SAVE REGISTERS LR R12,R15 ESTABLISH BASE USING MYPROG,R12 ADDRESSABILITY L R2,0(,R1) LOAD PARM ADDRESS LH R3,0(,R2) LOAD PARM LENGTH LTR R3,R3 CHECK IF LENGTH > 0 BZ NOPARM BRANCH IF NO PARM LA R4,2(,R2) POINT TO PARM TEXT * Process parameter data NOPARM EQU * * Continue program

In PL/I:

pli
1
2
3
4
5
6
7
MYPROG: PROCEDURE(PARM) OPTIONS(MAIN); DECLARE PARM CHAR(100) VARYING; PUT SKIP LIST('Parameter received: ' || PARM); /* Process parameter */ END MYPROG;

Examples

Simple Parameter

jcl
1
//STEP1 EXEC PGM=MYPROG,PARM='DEBUG'

Passes the value 'DEBUG' to program MYPROG

Multiple Options

jcl
1
//STEP2 EXEC PGM=SORT,PARM='CORE=MAX,MSG=CRITICAL'

Passes sort options to the SORT utility

With Special Characters

jcl
1
//STEP3 EXEC PGM=REPORT,PARM='TITLE=Q1''23 RESULTS'

Note the doubled single quote to include an apostrophe in the parameter value

Parameter to a Procedure Step

jcl
1
//STEP4 EXEC PROC=PAYROLL,PARM.CALC='OVERTIME=YES'

Passes 'OVERTIME=YES' to the CALC step within the PAYROLL procedure

Continued Parameter

jcl
1
2
//STEP5 EXEC PGM=ANALYZE,PARM='SOURCE=MAINDATA,TARGET=REPORTING,MODE=BATCH, // VALIDATE=YES,TRACE=ON'

Long parameter string continued on the next line

Use Cases

  • Program Control Options
    • Debug flags (ON/OFF, level of detail)
    • Runtime modes (BATCH, ONLINE, TEST)
    • Feature toggles or configuration options
  • Data Processing Instructions
    • File names or dataset identifiers
    • Record formats or layouts to use
    • Processing dates or date ranges
    • Region or business unit selectors
  • Utility Program Options
    • SORT parameters (sort keys, input/output options)
    • IDCAMS control options
    • IEBGENER formatting options
    • Compiler options
  • Performance Tuning
    • Buffer specifications
    • Memory allocation parameters
    • Processing thresholds
    • Parallel operation controls

Common Utilities and Their PARM Usage

UtilityCommon PARM OptionsExample
SORTCORE, MSG, EQUALS, LISTPARM='CORE=MAX,MSG=AP'
IDCAMSGRAPHICS, CATALOGPARM='GRAPHICS(CHAIN(CH1,CH2))'
IEBGENERRECORD, MEMBER, MODPARM='RECORD=FB,MEMBER=YES'
COBOL CompilerDYNAM, XREF, OPT, NUMPROCPARM='XREF,OPT(2),SOURCE'
IEFBR14Not typically usedPARM='' (or omitted)

PARM with Procedures

When using PARM with procedures, you have two options:

  • Global PARM: Parameters passed to all steps that accept parameters
    jcl
    1
    //STEP1 EXEC PROC=PAYROLL,PARM='REGION=WEST'
  • Step-specific PARM: Parameters passed to a specific step in the procedure
    jcl
    1
    //STEP1 EXEC PROC=PAYROLL,PARM.CALC='REGION=WEST',PARM.REPORT='DETAIL=YES'

PARM with Symbolic Parameters

You can use symbolic parameters within PARM strings for greater flexibility:

jcl
1
2
3
4
//PROCSTEP PROC ENV='PROD' //STEP1 EXEC PGM=MYPROG,PARM='ENVIRONMENT=&ENV' // //RUNJOB EXEC PROCSTEP,ENV='TEST'

The PARM value becomes 'ENVIRONMENT=TEST' when the procedure is executed.

Limitations

  • Length: Standard limit is 100 characters (can be installation-dependent)
  • Format: The program must know how to parse the PARM data correctly
  • Coding: Special characters and continuation can be error-prone
  • Visibility: PARM data appears in job logs, which can be a security concern for sensitive information
  • Dynamic Access: PARM values are fixed at step initialization and cannot be changed during execution

Alternatives to PARM

For situations where PARM is insufficient or impractical, consider these alternatives:

AlternativeAdvantagesUse When
SYSIN DDNo length limitation, structured inputParameters are complex or lengthy
Parameter datasetsReusable, shareable, secureParameters need to be used across multiple jobs
System symbolsSystem-wide consistencyParameters should be standardized across the system
STDENV DDEnvironment variable-like interfaceWorking with USS or Java programs

Common Mistakes

  • Incorrect quote handling - Forgetting to double single quotes within parameter text
    jcl
    1
    2
    //BAD EXEC PGM=REPORT,PARM='TITLE=Q1'23 RESULTS' // ERROR //GOOD EXEC PGM=REPORT,PARM='TITLE=Q1''23 RESULTS' // CORRECT
  • Exceeding length limits - Creating parameters beyond the 100-character limit
    jcl
    1
    //TOOLONG EXEC PGM=PROCESS,PARM='EXTREMELY LONG PARAMETER TEXT THAT CONTINUES FOR MANY CHARACTERS AND WILL LIKELY EXCEED THE LIMITATION OF 100 CHARACTERS WHICH WILL CAUSE JCL ERRORS WHEN SUBMITTED' // ERROR
  • Incorrect procedure step reference - Specifying the wrong step name when overriding parameters
    jcl
    1
    2
    //RUN EXEC PROC=MONTHLY,PARM.STEP2='MODE=BATCH' // ERROR if no STEP2 //FIXED EXEC PROC=MONTHLY,PARM.REPORT='MODE=BATCH' // CORRECT if REPORT exists
  • Invalid continuation - Not continuing properly across lines
    jcl
    1
    2
    3
    4
    5
    //STEP1 EXEC PGM=ANALYZE,PARM='SOURCE=MAINDATA, TARGET=REPORTING' // ERROR - missing continuation sign //FIXED EXEC PGM=ANALYZE,PARM='SOURCE=MAINDATA, // TARGET=REPORTING' // CORRECT
  • Incompatible parameters - Passing parameters the program doesn't support
    jcl
    1
    //STEP1 EXEC PGM=UTILITY,PARM='UNKNOWN=YES' // Program may ignore or abend

Best Practices

  • Document the accepted parameters for your programs and their formats
  • For complex parameter strings, consider using a SYSIN DD instead of PARM
  • Use symbolic parameters to make PARM values configurable
  • Validate parameter values in your program to prevent unexpected behavior
  • Consider security implications when passing sensitive data via PARM
  • Use parameter standards and consistent formats across your applications
  • For procedures, clearly document which steps accept PARM values
  • Test parameter handling with boundary cases (empty, maximum length, special characters)

Related Concepts

Related Pages