Search code examples
jcl

Symbolic JCL Confusion


I am a bit confused on how to create a symbolic variable in JCL for an assignment I am doing in my COBOL class.

For example, I am supposed to "Specify a symbolic parameter for the PARM option and specify TEST and APOST as the default."

How do I designate the "PARM" option to be a symbolic parameter?

EDIT: Forgive the oversight; it seems that I forgot to mention what OS I am running in. I am writing this JCL file in z/OS.

Thanks in advance!

EDIT:

@avisser:

So, what you're saying is that I can just call it "&PARM='TEST,APOST'" and, if I wanted to change that parameter when I run this proc with another JCL statement, the parms listed can be changed from the calling JCL?

EDIT:

@avisser:

Yeah, sorry, I really need to work on being more specific... In my COBOL JCL, I am calling the COBOL compiler (IGYCRCTL), the Linkage Editor (HEWL) and a program fetch (EXEC PGM=).

EDIT:

Perhaps it would help to see what my output is. I really do appreciate all those who have tried to help so far.

Output:

------ JES2 JOB STATISTICS ------

       37 CARDS READ                                                                                                            

       61 SYSOUT PRINT RECORDS                                                                                                  

        0 SYSOUT PUNCH RECORDS                                                                                                  

        3 SYSOUT SPOOL KBYTES                                                                                                   

     0.00 MINUTES EXECUTION TIME                                                                                                

!! END OF JES SPOOL FILE !! 1 //KC03CEFA JOB ,'MATT R',MSGCLASS=H,TYPRUN=SCAN JOB07731 //*
2 //STEP01 EXEC PGM=IGYCRCTL,&REGION=248K,
// &PARM='TEST,APOST'
3 //STEPLIB DD DSN=IGY340.SIGYCOMP,DISP=SHR
/*
4 //SYSLIN DD &DSN=&&OBJSET,UNIT=DISK,SPACE=(TRK,(3,3)),
// &DISP=(NEW,PASS,DELETE)
5 //SYSPRINT DD SYSOUT=*
6 //SYSUT1 DD UNIT=DISK,SPACE=(CYL,(1,1))
7 //SYSUT2 DD UNIT=DISK,SPACE=(CYL,(1,1))
8 //SYSUT3 DD UNIT=DISK,SPACE=(CYL,(1,1))
9 //SYSUT4 DD UNIT=DISK,SPACE=(CYL,(1,1))
10 //SYSUT5 DD UNIT=DISK,SPACE=(CYL,(1,1))
11 //SYSUT6 DD UNIT=DISK,SPACE=(CYL,(1,1))
12 //SYSUT7 DD UNIT=DISK,SPACE=(CYL,(1,1))
//*
//*
13 //STEP02 EXEC PGM=HEWL,&COND=,&REAGION=2048K,
// &PARM=
14 //SYSLIB DD DSN=CEE.SCEELKED,DISP=SHR
15 //SYSLIN DD &DSN=&&OBJSET,&DISP=(OLD,DELETE)
16 //SYSLMOD DD DSN=&&TEMPLIB(PGM6),
// SPACE=(1024,(50,20,1)),UNIT=DISK,
// DISP=(NEW,CATLG,DELETE)
17 //SYSPRINT DD SYSOUT=*
18 //PRINTER DD SYSOUT=*
19 //SYSUT1 DD UNIT=DISK,SPACE=(TRK,(10,10))
//*
//*
20 //STEP01 EXEC PGM=PGM6,&PARM=TERMTHDACT(DUMP)
21 //STEPLIB DD DSN=&&TEMPLIB,DISP=SHR
22 //CEEDUMP
23 //SYSUDUMP
24 //PRINTER DD SYSOUT=*
25 //PRODUCTS DD DSN=KC02322.CSCI465.SP09(DATA1),DISP=SHR
26 //SYSIN DD *
!! END OF JES SPOOL FILE !! STMT NO. MESSAGE 2 IEFC630I UNIDENTIFIED KEYWORD &REGION 2 IEFC630I UNIDENTIFIED KEYWORD &PARM 4 IEFC630I UNIDENTIFIED KEYWORD &DSN 4 IEFC630I UNIDENTIFIED KEYWORD &DISP 13 IEFC630I UNIDENTIFIED KEYWORD &COND 13 IEFC630I UNIDENTIFIED KEYWORD &REAGION 13 IEFC630I UNIDENTIFIED KEYWORD &PARM 15 IEFC630I UNIDENTIFIED KEYWORD &DSN 15 IEFC630I UNIDENTIFIED KEYWORD &DISP 20 IEFC630I UNIDENTIFIED KEYWORD &PARM 22 IEFC605I UNIDENTIFIED OPERATION FIELD 23 IEFC605I UNIDENTIFIED OPERATION FIELD !! END OF JES SPOOL FILE !!


Solution

  • symbolic parameters are names preceded by an ampersand. When used in a JCL statement, at runtime they get converted into the supplied value. One way of creating them (on z/OS) is using a

    // SET name = value

    declaration. If you use a PARM, you should design your program so that it can work with one. Perhaps the assignment is about how to do that (hint: linkage section). Or is JCL a part of your COBOL class?

    TEST and APOST look to me like compiler directives. I don't know if you can specify them in your program, at my workplace we only supply them when calling the compiler.

    EDIT:

    Ok this is a bit unusual to me, as we tend to compile and run our programs in separate JCL streams. But anyway.

    Taking your second statement:

    2 //STEP01 EXEC PGM=IGYCRCTL,&REGION=248K,
      // &PARM='TEST,APOST'
    

    REGION and PARM are so-called positional parameters and they are keywords, not really meant to be presented as symbolic names, although you're free to do so (this will explain the "UNIDENTIFIED KEYWORD" messages).
    The common use - when applicable - is to provide symbolic names for the operands of such parameters. And obviously you have to define a value for them first, e.g:

      // SET OPTIONS='TEST,APOST'
      //STEP01 EXEC PGM=IGYCRCTL,REGION=248K,
      // PARM=&OPTIONS