IDENTIFICATION DIVISION.
PROGRAM-ID. MYPROG.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
LINKAGE SECTION.
01 PARM.
03 PARM-LENGTH PIC S9(04) COMP SYNC.
03 THE-PARM.
05 CHANNEL PIC X(01).
PROCEDURE DIVISION USING PARM.
DISPLAY THE-PARM.
IF CHANNEL = 'R' THEN MOVE 1 TO RETURN-CODE
ELSE IF CHANNEL = 'L' THEN MOVE 2 TO RETURN-CODE
ELSE MOVE 4 TO RETURN-CODE.
STOP RUN.
PROGRAM-ID. MYPROG.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
LINKAGE SECTION.
01 PARM.
03 PARM-LENGTH PIC S9(04) COMP SYNC.
03 THE-PARM.
05 CHANNEL PIC X(01).
PROCEDURE DIVISION USING PARM.
DISPLAY THE-PARM.
IF CHANNEL = 'R' THEN MOVE 1 TO RETURN-CODE
ELSE IF CHANNEL = 'L' THEN MOVE 2 TO RETURN-CODE
ELSE MOVE 4 TO RETURN-CODE.
STOP RUN.
and the JCL:
//*
// SET CHANNEL='L'
//*
//STEP1 EXEC PGM=MYPROG,PARM='&CHANNEL'
//STEPLIB DD DISP=SHR,DSN=...
//SYSOUT DD SYSOUT=*
//*
// IF (STEP0001.RC = 1) THEN
//STEP2A EXEC PGM=PROCESS1
// ENDIF
// IF (STEP0001.RC = 2) THEN
//STEP2B EXEC PGM=PROCESS2
// ENDIF
//*