tags:

views:

1464

answers:

2

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 !!

+3  A: 

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
Albert Visser
Wow. +1 just for knowing what JCL is.
Charlie Martin
I ended up figuring it out (and it is a bit different than what you showed me), but your advice was very helpful. Thank you very much.
Enyalius
as mentioned, SET is just one way of defining a value to a parameter. Providing them on the procedure call is another, but I thought SET would be easier to start with,.
Albert Visser
+1  A: 

Ok, I did some digging, and, with the guidance that avisser gave me, I was able to figure out what I had to do. So, for future reference for anyone who might have this question (or one similar), here is what I figured out:

Step 1: Create a "PROC" with the variables you will be using.

ex. I wanted to use variables for the "PARM" in my COBOL compiler that had the default values of "TEST" and "APOST", so I wrote something like:

//PROC1  PROC  CPARM='TEST,APOST',

Step 2: Use those newly defined symbolic parameters in your actual JCL step. The "&" character shows that whatever follows it is a symbolic parameter.

ex. I used the aforementioned "CPARM" for my COBOL compile step:

//COB    EXEC  PGM=IGYCRCTL,REGION=&CREGION,  
//             PARM='&CPARM'

Step 3: End your "PROC" with a "PEND" statement after your actual step.

ex. After I listed all of my variables and I listed all the steps for compilation (compiler name, where the compiler can be found, and, as can be seen right before the PEND statement, the SYSUT1-SYSUT7 statements), place your PEND keyword:

//SYSUT7   DD UNIT=DISK,SPACE=(CYL,(1,1))  
//         PEND

Step 4: Add any additional JCL steps and/or code to your source file and you're off!

Notes:

-You can have more than one PROC statement in a single JCL file. I had three: one for COBOL compilation, one for the linkage editor and one for the program fetch. I also have COBOL code in the same file that my PROC statements are in.

-This took place on an IBM Mainframe running z/OS.

-Above, it can be seen that my "CPARM" variable is set to the default of 'TEST,APOST'. It is possible to have a variable be null by default by simply leaving the field blank (ex. CPARM=,).

-You may have noticed that after the CPARM definition, there is a comma; this is because I have more variables after it. Please remember that the last symbolic parameter you create for any given PROC should have nothing following it (ie. no comma). You can, of course, place a comment line (//*), another PROC or actual code afterward, but the last symbolic parameter should have nothing following it on the same line.

Enyalius