MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Invoking a REXX program from JCL
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Jan 13, 2003 2:20 am    Post subject: Invoking a REXX program from JCL Reply with quote

I need to invoke a REXX routine from a JCL and pass certain parameters to the REXX routine.

Can somebody throw some light on it

Thanks & Regards,
Navin. J
Back to top
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Mon Jan 13, 2003 2:47 am    Post subject: Reply with quote

You can run it using IKJEFT01. This program basically invokes the TSO environment from the JCL.

Something Like -
Code:

//Jobcard
//PGMLOAD EXEC PGM=IKJEFT01
//SYSPROC
//ISPPLIB
//ISPMLIB
//ISPTLIB
//SYSPRINT
//SYSOUT
//SYSTSIN DD *
  ISPSTART CMD(your.rexx.routine  parms)
/*
//*

Make sure that you are specifying the correct libraries in the ISPPLIB, SYSPROC and ISPMLIB etc. libraries.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Jan 13, 2003 4:14 am    Post subject: Reply with quote

Manas,

Thanks you for reply. I have used ISPPLIB & ISPMLIB but I haven't used ISPTLIB in any of my programs. Can you kindly explain me what is it. And also about SYSPROC, what should it contain ?

Thanks for you kind help,
Navin. J
Back to top
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Mon Jan 13, 2003 4:48 am    Post subject: Reply with quote

Put your CLIST,REXX and Edit macro libraries in the SYSPROC. And put your ISPF table dataset in ISPTLIB.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Jan 13, 2003 5:43 am    Post subject: Reply with quote

Manas,

Thanks for your code. I tried it but I got an error. Pls find the attached the SYSTSPRT message.

READY
ISPSTART CMD(ADVFIND)
ISPI003 Following file was not preallocated:
ISPPROF
READY
END

I tried to invoke REXX program which uses a PANEL. I hope we can invoke a foreground (PANEL) job from a JCL. Here is the JCL I used.
Code:

//TSONJAYB JOB (ACCOUNT),'SRCHJCL',CLASS=E,         
//         TIME=(1440),                             
//         MSGCLASS=X,NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//R010 EXEC PGM=IKJEFT01                           
//SYSPROC  DD DSN=TSONJAY.REXX.UTILS,DISP=SHR       
//ISPPLIB  DD DSN=TSONJAY.REXX.PANELS,DISP=SHR     
//ISPMLIB  DD DSN=TSONJAY.REXX.MESSAGES,DISP=SHR   
//SYSPRINT DD SYSOUT=U                             
//SYSTSPRT DD SYSOUT=U                             
//SYSTSIN  DD *                                     
  ISPSTART CMD(ADVFIND)                             
/*                                                 
//*                                                 


My Rexx program is 'ADVFIND' which is residing in the PDS 'TSONJAY.REXX.UTILS' and it used panels which I've stored in the PDS 'TSONJAY.REXX.PANELS' and messages in 'TSONJAY.REXX.MESSAGES'.

Can you kindly help me resolving this problem.
Thanks & Regards,
Navin. J
Back to top
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Mon Jan 13, 2003 5:51 am    Post subject: Reply with quote

Hi Navin,

How can you throw a panel if you are executing your REXX routine from a JCL. You cannot do it. We generally invoke such REXX rountines from JCL which do some processing and do not need any communication in the form of panels. If you are using panels, then use REXX in the foreground.

As far as the ISPPROF error is concerned, try giving the followinf DDNAME along with the others in IKJEFT01 -

Code:

//ISPPROF  DD DSN=,DISP=(NEW,DELETE),UNIT=,         
//    DCB=(RECFM=FB,LRECL=80,BLKSIZE=3120,DSORG=PO),
//    SPACE=(3120,(20,5,10))                       


Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Jan 13, 2003 6:32 am    Post subject: Reply with quote

Manas,

Thank you very much for clarifying my doubts. since, you speficied PANEL libraries ISPPLIB... in your code I thought we can invoke a PANEL. Well, thanks for clarifying that.

Can you kindly tell why we need to use these PANEL libraries in the job when we cannot invoke a PANEL from a JCL.

thanks,
Navin. J
Back to top
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Mon Jan 13, 2003 8:19 am    Post subject: Reply with quote

Hi Navin,

Frankly speaking I don't know. I use standard JCLs in our installation for running REXX routines. Yes, logically we don't need ISPPLIB in the JCL, but it is always there in the JCL and it contains a list of system datasets allocated to it. Maybe these system panel datasets are required for ISPF services but I am not sure. You will also probably get a JCL in yorub installation. Just concatenate your datasets to SYSPROC, ISPTLIB, ISPTABL and try running the job.
Maybe some other members of this board can help clarify on why we need ISPPLIB in the JCL to run REXX routines in batch.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Jan 13, 2003 8:48 am    Post subject: Reply with quote

Manas,

Thanks for your reply. I tried to run the jcl with the ISPPROF card as you specified, but still I got an error RC = 0998 saying that ISPSLIB is missing, then I provided the ISPSLIB card appropriately (ISPSLIB DD DSN = TSONJAY.ISPSLIB,DISP=SHR), then It showed me an error message (RC=0998) again saying that Message ISV010 is not found the ISPMLIB library. then I created a message PS in the ISPMLIB library. But still it gave an error RC = 0998 but without any error message.

Then I removed all ISPPLIB, ISPSLIB, ISPTLIB, ISPMLIB,... and ran the JCL and it worked fine. Here is the JCL.

//TSONJAYB JOB (ACCOUNT),'SRCHJCL',CLASS=E,
// TIME=(1440),
// MSGCLASS=X,NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//R010 EXEC PGM=IKJEFT01
//SYSPROC DD DSN=TSONJAY.REXX.UTILS,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
ADDSAY 'HELLO'
/*
//* HELLO is the parameter I'm passing to the REXX routine
//


I am getting the ISPPROF not found error only when I specify 'ISPSTART CMD (ADDSAY)', but when I tried to run as shown above I got no errors.

Thanks & Regards,
Navin. J
Back to top
View user's profile Send private message
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Mon Jan 13, 2003 8:55 am    Post subject: Reply with quote

Using ispstart implies you want to use ispf services so that's why it needs the ispf files. Your code doesn't appear to need ispf services.
Back to top
View user's profile Send private message
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Mon Jan 13, 2003 5:38 pm    Post subject: Reply with quote

In a follow up to Phantom's reply, basically there are three methods of invoking A rexx program via JCL, depending upon the environmental requirements.

The simplest method of running a Rexx program in batch is to utilise the IRXJCL program, however this has limitations in that TSO/E or ISPF environments are not available.

e.g
Code:

//MYJOB    JOB .......
//*
//STEP010  EXEC PGM=IRXJXL,PARM='MYREXX'
//*
//SYSEXEC  DD DSN=MY.REXX.LIB,DISP=SHR
//SYSTSIN  DD DSN=MY.TERMINAL.IN,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//*----------------------------------------------------------


The next method is to utilise the IKJEFT01 program (or one of the similar TSO/E programs) in conjunction with using either the parm field or data passed via sysin to invoke the Rexx program directly. With this method a TSO/E environment is available, but not ISPF.

e.g.
Code:

//MYJOB    JOB ........
//*
//STEP010 EXEC PGM=IKJEFT01
//*
//SYSPROC  DD DSN=YOUR.SYSTEM.CLISTS,DISP=SHR
//SYSEXEC  DD DSN=YOUR.EXEC.LIB,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN   DD *
 MYEXEC


Note You could invoke the MYEXEC REXX by changing the SYSTSIN dd statement to be DUMMY (or just have no data) in conjunction with adding PARM='MYEXEC' on the program EXEC statement. In fact you can have both a PARM and data for SYSTSIN, the PARM statement gets invoked first.

NoteThe REXX program can be placed into a library concatendated to either the SYSEXEC ddname or to the SYSPROC ddname. If the latter than the REXX program must have the word REXX in the first line which must also be a comment.

The third method is an extension of the above method and allows/starts and ISPF Environment. You need to add the ISPF libraries (as previous posts have explained). You the invoke the ISPF environment via the ISPSTART command using the CMD option to specify the Rexx program (this is not limited to just Rexx programs) and any parameters you wish to pass to the Rexx program.

Personally I tend to use the first, as per the order I've discussed them, that meets the environmental requirements. In you case using IRXJCL would suffice.
_________________
Regards,
Mike.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Mon Jan 13, 2003 10:28 pm    Post subject: Reply with quote

And a reminder that a program to automatically create the JCL to invoke ISPF in batch using your shop's ISPF libraries can be found at http://www.sillysot.com/mvs under BATCHPDF
Back to top
View user's profile Send private message Visit poster's website
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Tue Jan 14, 2003 12:59 am    Post subject: Reply with quote

Hi Tallyman, Mike and Semigeezer,

One part of Phantom's question(well my question too now) still remains unanswered. Let us consider the case when we are using ISPF services in our REXX program. In that case we have to use ISPSTART and we have to specify ISPPLIB although we have nothing to do with panels. Why is that??

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue Jan 14, 2003 1:56 am    Post subject: Reply with quote

ISPF just requires it. If for example, there is an error at run time, ISPF will normally display an error panel. Even though you can't see that in BATCH, ISPF is operating the same way it does in foreground. It processes panels in batch the same way it does in foreground so the panel libraries (and messages and skeletons) are required - just in case. The messages are, in fact, used for logging.

You'd see the same error in foreground if you were to run, without ISPPLIB, a command that doesn't display a panel such as
ISPSTART PGM(IEFBR14)
Back to top
View user's profile Send private message Visit poster's website
dorkhead
Beginner


Joined: 07 Jan 2003
Posts: 25
Topics: 0
Location: Lux

PostPosted: Wed Jan 15, 2003 5:37 am    Post subject: Reply with quote

How can you throw a panel if you are executing your REXX routine from a JCL. You cannot do it.


technically this is feasible... it may be useful specially when using edit macros...
_________________
Dorkhead
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group