Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 4650
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: 4650
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 DUMMY When do I need add a DCB parameter Martylin JCL & VSAM 3 Fri Dec 08, 2017 7:20 am
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us