Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to pass a parameter from JCL to CLIST program?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Red Rabbit

New User


Joined: 06 Apr 2006
Posts: 5
Location: Kolkata

PostPosted: Thu Apr 06, 2006 5:49 pm    Post subject: How to pass a parameter from JCL to CLIST program?
Reply with quote

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
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Apr 06, 2006 6:02 pm    Post subject: Re: How to pass a parameter from JCL to CLIST program?
Reply with quote

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
View user's profile Send private message
Red Rabbit

New User


Joined: 06 Apr 2006
Posts: 5
Location: Kolkata

PostPosted: Thu Apr 06, 2006 7:09 pm    Post subject: Re: How to pass a parameter from JCL to CLIST program?
Reply with quote

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
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Apr 06, 2006 9:01 pm    Post subject: Re: How to pass a parameter from JCL to CLIST program?
Reply with quote

Have you reviewed the information in Chapter 2.3.1 Passing Parameters to CLISTs in the z/OS V1R7.0 TSO/E CLISTs manual?
Back to top
View user's profile Send private message
Red Rabbit

New User


Joined: 06 Apr 2006
Posts: 5
Location: Kolkata

PostPosted: Fri Apr 07, 2006 10:26 am    Post subject:
Reply with quote

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.,
Code:
PROC 2 DSN1 SN2


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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts DDNAME parameter mistah kurtz JCL & VSAM 6 Mon Dec 19, 2016 4:41 pm
No new posts Execessive parameter issue Sumeendar JCL & VSAM 5 Mon Dec 19, 2016 4:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us