how to execute a rexx program



IBM's Command List programming language & Restructured Extended Executor

how to execute a rexx program

Postby supriya saraswat » Tue Aug 05, 2008 3:00 pm

i have wriiten a rexx code but don't know how to execute it...can any one tell me..
is exit necessary in the last of the rexx program.
is rexx program start with /* rexx*/
if yes ..then why it appears as comment.
in jcl where should i add my rexx code.
i searched many manuals but i am unable to undestand that.
in some manuals i found %myrexx
what is this?is this means rexx code.



please answer my questions..and if possible provide me a sample screen shots as an example for describing how to execute a rexx program..having jcl plus rexx code

u can take a simple example like
say "hello world"
supriya saraswat
 
Posts: 21
Joined: Mon Jul 07, 2008 3:24 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to execute a rexx program

Postby MrSpock » Tue Aug 05, 2008 5:56 pm

Wow, you certainly packed a lot of issues into a short topic, and you didn't provide a lot of details for what you want to do specifically. It's hard to tell from your topic how much experience you have with using Clist or REXX or TSO/E, so I'll take this a step at a time. I will presume that we're talking about executing an interpreted REXX exec, not a compiled one.

You can execute a native REXX exec using the REXX interpreter program IRXJCL. A typical job looks like this, where MYREXX is your REXX program and REXX.PDS is the PDS where your code is stored:
//STEPXXXX EXEC PGM=IRXJCL,PARM='MYREXX'
//SYSEXEC  DISP=SHR,DSN=REXX.PDS
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD DUMMY


You asked if it is necessary to code the EXIT instruction. No, it is not.
You asked if it is necessary to code the /* REXX */ comment. In this case, since you are using the REXX interpreter, it is not necessary. More on this subject in a minute.

Now, suppose you want to do more than what just REXX can do. To create a much more powerful application, you can use REXX together with all of the TSO/E commands that you are already familiar with. To use TSO/E and REXX together, you can use the same job as above with one minor change:
//STEPXXXX EXEC PGM=IKJEFT01,PARM='MYREXX' or PARM='%MYREXX'
//SYSEXEC  DISP=SHR,DSN=REXX.PDS or //SYSPROC  DISP=SHR,DSN=REXX.PDS
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD DUMMY

or

//STEPXXXX EXEC PGM=IKJEFT01
//SYSEXEC  DISP=SHR,DSN=REXX.PDS or //SYSPROC  DISP=SHR,DSN=REXX.PDS
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD *
MYREXX or %MYREXX
/*

or

//STEPXXXX EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD *
EX 'REXX.PDS(MYEXEC)'
/*


IKJEFT01 is the TSO/E Terminal Monitor Program (TMP). You can read more about it in the link I provided. Now, if you're using TSO/E to run your REXX exec, you need a way to tell TSO/E that your code is written in REXX and not CLIST. This is where you need to provide the /* REXX */ comment at the beginning of the code. That is a signal to the TSO/E command processor to tell it to use the REXX interpreter, not the CLIST interpreter. Notice that you can call your exec with or without the percent (%) if front of the name. Using the percent sign (%) in front of a TSO/E command let's the command processer know that what you're executing is not a program, so it can take a shortcut through the executable library allocations and jump directly to looking only at command libraries. It's considered to save some time and system overhead.

Now, suppose you get tired of running your REXX execs in batch, and you want to instead run them in the foreground of TSO/E. Well, since TSO/E supports REXX, then all you need to do is use the TSO/E explicit or implicit EXEC command as I already showed above.

Now, after all this, you still want to do more, and you want to start including ISPF Services into your REXX exec's. If you're running in the foreground, and presuming that your logon session creates a TSO/E address space, and then starts ISPF for you, you should be able to use of the ISPF Services anytime you want, the same way you would for any program using ISPF Services. If you want the same services in a batch TSO/E job, just don't forget that you need to allocate all of the necessary libraries to allow ISPF services to run, and that you need to start ISPF via the ISPSTART command.
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post