Page 1 of 3

How to supply parameter

PostPosted: Fri Dec 23, 2011 11:44 pm
by clapclash
Hi everyone, I am new to JCL and I have a question: how do you supply parameters to SYSTSIN DD statement?
The piece of code I am trying to fix is this:

//SYSTSIN DD *
RUN PLAN(ADDMATR) PROGRAM(ADDMATR)
//SYSTSPRT DD SYSOUT=*

The parameter I have to supply is in the format: xxxxxxxx-xx-xxxxxxxx-xx-xx

I hope you can help or maybe just suggest a good book for beginners,

Thanks

Re: How to supply parameter

PostPosted: Sat Dec 24, 2011 12:26 am
by BillyBoyo
//anyname DD *


The * just tells the operating system that when a program opens, reads and closes the file, the data to be used is that which follows the DD statement, until "/*" (an indicator of no more cards, old-style) or another JCL statement is encountered (// in columns 1 and 2) or the end of the JCL is reached.

I don't know where you think parameters comes into it. You can supply as many "cards" as you like following the DD *, but I don't know if that is what you mean.

Any time you see DD *, you could also replace the * with the dataset-name of a fixed-length (RECFM F or FB) which could be an ordinary sequential file or a PDS member, and that dataset/member can contain the data achieving the same effect as the DD *.

Re: How to supply parameter

PostPosted: Sat Dec 24, 2011 12:28 am
by steve-myers
I think, properly speaking, that this is a DB2 question, not a JCL question, and that the parameter is to be supplied with the RUN PLAN command.

Re: How to supply parameter

PostPosted: Sat Dec 24, 2011 12:35 am
by clapclash
BillyBoyo wrote:
//anyname DD *


The * just tells the operating system that when a program opens, reads and closes the file, the data to be used is that which follows the DD statement, until "/*" (an indicator of no more cards, old-style) or another JCL statement is encountered (// in columns 1 and 2) or the end of the JCL is reached.

I don't know where you think parameters comes into it. You can supply as many "cards" as you like following the DD *, but I don't know if that is what you mean.

Any time you see DD *, you could also replace the * with the dataset-name of a fixed-length (RECFM F or FB) which could be an ordinary sequential file or a PDS member, and that dataset/member can contain the data achieving the same effect as the DD *.


Thank you for the quick answer. I basically need to supply this kind of variable/parameter xxxxxxxx-xx-xxxxxxxx-xx-xx (all x are digits) to the program and the program will calculate the result based on this parameter.
So far I have tried this:

//SYSTSIN DD *
RUN PLAN(ADDMATR) PROGRAM(ADDMATR)
xxxxxxxx-xx-xxxxxxxx-xx-xx
/*
//SYSTSPRT DD SYSOUT=*
//ADDMATR DD SYSOUT=*
//SYSOUT DD SYSOUT=*

but it gives me an error, so am I supposed to supply this parameter to the JCL using in-stream data???
Thanks for your help

Re: How to supply parameter

PostPosted: Sat Dec 24, 2011 12:55 am
by BillyBoyo
Do you have any colleagues around who have something similar working already?

From a quick google it might be

 
  RUN PLAN(ADDMATR) PROGRAM(ADDMATR) PARMS('xxxxxxxx-xx-xxxxxxxx-xx-xx')


As Steve suggested, a DB2 question.

Re: How to supply parameter

PostPosted: Sat Dec 24, 2011 1:09 am
by clapclash
BillyBoyo wrote:Do you have any colleagues around who have something similar working already?

From a quick google it might be

 
  RUN PLAN(ADDMATR) PROGRAM(ADDMATR) PARMS('xxxxxxxx-xx-xxxxxxxx-xx-xx')


As Steve suggested, a DB2 question.



I have tried it but with no results. I know that the problem is related to the parameter I have to supply, but I don't know how to work with it.
I paste the entire program so you guys might have a look at it again:

//ADDMATR JOB MSGCLASS=H,NOTIFY=&SYSUID
//ADDMATR EXEC PGM=IKJEFT01, PARM='DSN SYSTEM(DB1S)'
//STEPLIB DD DISP=SHR,DSN=DB2.V9R1.SDSNLOAD
DD DISP=SHR,DSN=ZOS.PART2.LOAD
//SYSTSIN DD *
RUN PLAN(ADDMATR) PROGRAM(ADDMATR)
//SYSTSPRT DD SYSOUT=*
//ADDMATR DD SYSOUT=*
//SYSOUT DD SYSOUT=*


And this is the output when I submit it:

13.34.52 JOB06386 $HASP165 ADDMATR ENDED AT ZOS19 MAXCC=99 CN(INTERNAL)

I hope someone of you can help me to understand it. Thanks

Re: How to supply parameter

PostPosted: Sat Dec 24, 2011 5:35 am
by BillyBoyo
You're going to need to show us some of the output from your job.

Are you using ISPF? Do you have access to SDSF or something else to look at "spool output files" with? Outlst, maybe?

Re: How to supply parameter

PostPosted: Sat Dec 24, 2011 5:55 am
by clapclash
BillyBoyo wrote:You're going to need to show us some of the output from your job.

Are you using ISPF? Do you have access to SDSF or something else to look at "spool output files" with? Outlst, maybe?



Here the SDSF:


********************************* TOP OF DATA **********************************
J E S 2 J O B L O G -- S Y S T E M M V S T -- N O D

18.11.01 JOB06448 ---- FRIDAY, 23 DEC 2011 ----
18.11.01 JOB06448 IRR010I USERID UK00242 IS ASSIGNED TO THIS JOB.
18.11.01 JOB06448 ICH70001I UK00242 LAST ACCESS AT 17:57:26 ON FRIDAY, DECEMBE
18.11.01 JOB06448 $HASP373 ADDMATR STARTED - INIT 1 - CLASS A - SYS MVST
18.11.01 JOB06448 IEF403I ADDMATR - STARTED - TIME=18.11.01
18.11.01 JOB06448 - --TIMINGS (MINS.)--
18.11.01 JOB06448 -JOBNAME STEPNAME PROCSTEP RC EXCP CPU SRB CLOCK
18.11.01 JOB06448 -ADDMATR ADDMATR 99 183 .00 .00 .00
18.11.01 JOB06448 IEF404I ADDMATR - ENDED - TIME=18.11.01
18.11.01 JOB06448 -ADDMATR ENDED. NAME- TOTAL CPU TIME=
18.11.01 JOB06448 $HASP395 ADDMATR ENDED
------ JES2 JOB STATISTICS ------
23 DEC 2011 JOB EXECUTION DATE
20 CARDS READ
67 SYSOUT PRINT RECORDS
0 SYSOUT PUNCH RECORDS
3 SYSOUT SPOOL KBYTES
0.00 MINUTES EXECUTION TIME
1 //ADDMATR JOB MSGCLASS=H,NOTIFY=&SYSUID
IEFC653I SUBSTITUTION JCL - MSGCLASS=H,NOTIFY=UK00242
2 //ADDMATR EXEC PGM=IKJEFT01,
// PARM='DSN SYSTEM(DB1S)'
3 //STEPLIB DD DISP=SHR,DSN=DB2.V9R1.SDSNLOAD
4 // DD DISP=SHR,DSN=ZOS.CONTEST2.PART2.LOAD
5 //SYSTSIN DD *
6 //SYSTSPRT DD SYSOUT=*
7 //ADDMATR DD SYSOUT=*
8 //SYSOUT DD SYSOUT=*
ICH70001I UK00242 LAST ACCESS AT 17:57:26 ON FRIDAY, DECEMBER 23, 2011
IEF236I ALLOC. FOR ADDMATR ADDMATR
IGD103I SMS ALLOCATED TO DDNAME STEPLIB
IGD103I SMS ALLOCATED TO DDNAME
IEF237I JES2 ALLOCATED TO SYSTSIN
IEF237I JES2 ALLOCATED TO SYSTSPRT
IEF237I JES2 ALLOCATED TO ADDMATR
IEF237I JES2 ALLOCATED TO SYSOUT
IEF142I ADDMATR ADDMATR - STEP WAS EXECUTED - COND CODE 0099
IGD104I DB2.V9R1.SDSNLOAD RETAINED, DDNAME=STEPLIB
IGD104I ZOS.CONTEST2.PART2.LOAD RETAINED, DDNAME=
IEF285I UK00242.ADDMATR.JOB06448.D0000101.? SYSIN
IEF285I UK00242.ADDMATR.JOB06448.D0000102.? SYSOUT
IEF285I UK00242.ADDMATR.JOB06448.D0000103.? SYSOUT
IEF285I UK00242.ADDMATR.JOB06448.D0000104.? SYSOUT
IEF373I STEP/ADDMATR /START 2011357.1811
IEF374I STEP/ADDMATR /STOP 2011357.1811 CPU 0MIN 00.02SEC SRB 0MIN 00.00S
IEF375I JOB/ADDMATR /START 2011357.1811
IEF376I JOB/ADDMATR /STOP 2011357.1811 CPU 0MIN 00.02SEC SRB 0MIN 00.00S
DSN
RUN PLAN(ADDMATR) PROGRAM(ADDMATR)
DSN
END

ERROR:
Problem opening PARMS DD. COBOL File status key = 35

******************************** BOTTOM OF DATA ********************************

This is the original version and of course I have to supply the parameters. I am supposed to supply these integers to the JCL using in-stream data. I hope someone can help me.
Thanks

Re: How to supply parameter

PostPosted: Sat Dec 24, 2011 6:11 am
by Robert Sample
Problem opening PARMS DD. COBOL File status key = 35
This is typically called "a clue". It is telling you that DD name PARMS is required yet is not present in your JCL. Perhaps the programmer expects you to put your parameter in there?

Re: How to supply parameter

PostPosted: Sat Dec 24, 2011 6:15 am
by clapclash
Robert Sample wrote:
Problem opening PARMS DD. COBOL File status key = 35
This is typically called "a clue". It is telling you that DD name PARMS is required yet is not present in your JCL. Perhaps the programmer expects you to put your parameter in there?



I have already got the statement PARM='DSN SYSTEM(DB1S)' do you suggest me to add another one or something else?