View previous topic :: View next topic
|
Author |
Message |
Red Rabbit
New User
Joined: 06 Apr 2006 Posts: 5 Location: Kolkata
|
|
|
|
I want to check in my CLIST program whether a dataset exists or not. However, this dataset would not be known in advance. It (dataset name)needs to be passed through the JCL at the time of execution to the CLIST program.
Currently I am using the IKJEFT utility to execute CLIST program through JCL, but I don't know how to pass parameter through it.
Can anybody help. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Presuming that you have the parameter list in your CLIST:
PROC 1 DSN
WRITE &DSN
Then, the program is called
//STEP1 EXEC PGM=IKJEFT01,PARM='%CLIST MY.DSN.TO.CHK' |
|
Back to top |
|
|
Red Rabbit
New User
Joined: 06 Apr 2006 Posts: 5 Location: Kolkata
|
|
|
|
Hi superk,
Thanx for your reply.
I suppose in the line:
Quote: |
//STEP1 EXEC PGM=IKJEFT01,PARM='%CLIST MY.DSN.TO.CHK' |
%CLIST was supposed to be the CLIST program name preceded by '%'!!
However, when I tried it gave the following message:
Code: |
IKJ56716I EXTRANEOUS INFORMATION WAS IGNORED: MYDSN.TEMP.FILE
|
Also, it did not recognize the dataset as an existing one, though the dataset exists.
May be, having a look at the CLIST program and my JCL would give you a better idea:
CLIST program looks somewhat like:
Code: |
PROC 0
IF &SYSDSN(&DSN) = OK THEN +
DO
SET &RC = 3
END
ELSE +
DO
SET &RC = 4
END
EXIT CODE(&RC)
|
And the JCL:
Code: |
//JS0010 EXEC PGM=IKJEFT1B,DYNAMNBR=20,PARM='%DSNCHK MYDSN.TEMP.FILE'
//SYSPROC DD DSN=SYSLIB.DEV.CLIST.LIB,DISP=SHR
.
.
.
//SYSTSIN DD DSN=MYDSN.TEST5.JCL(CNTLCRD),DISP=SHR
|
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
Red Rabbit
New User
Joined: 06 Apr 2006 Posts: 5 Location: Kolkata
|
|
|
|
I got my mistake. Actually I forgot to mention the parameter list with the PROC statement. (See the code).
For those who are visiting this post regarding similar query, here is the way how to pass a parameter to the CLIST program through JCL:
In the CLIST program, we need to mention the number of parameters to be passed followed by the variables supposed to take those parameters in the PROC.
e.g.,
The above lilne indicates that there would be two parameters passed to this CLIST program and the first would be stored in the variable DSN! and the second in DSN2.
For the JCL part, we need to mention the parameter values right after the CLIST prgram name.
e.g., if our CLIST program name is CHKPRG, then
Code: |
%CHKPRG HLQ.MYDSN1 HLQ.MYDSN2 |
The above line would pass the values HLQ.MYDSN1 and HLQ.MYDSN2 to the CLIST program CHKPROG |
|
Back to top |
|
|
|