IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

NATURAL trick: Calling REXX directly from within NATURAL


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jan 17, 2006 12:20 pm
Reply with quote

Here is an example of executing a REXX exec directly from NATURAL under TSO or batch.
This example uses IRXJCL, which is the REXX standard routine for invoking REXX in MVS batch. The IRXJCL routine documented in the REXX Reference manual.
I put "directly", as opposed to other ways of executing REXX from within NATURAL. I will post the other ways in separate posts.

The NATURAL program:
Code:

DEFINE DATA LOCAL                       
1 #REXX-PARM                           
  2 #LEN (B2)                           
  2 #PARM (A80)                         
END-DEFINE                             
*                                       
#PARM := 'FROMNAT OFERF.A.REXX(FROMNAT)'
#LEN  := 80                             
*                                       
CALL 'IRXJCL' #LEN #PARM               
*                                       
END                                     


The REXX (this is an example only, you can execute any REXX):
Code:

/*------------------------------- REXX ------------------------------- 
 * PROGRAM   : FROMNAT                                                 
 * FUNCTION  : CALLED FROM NATURAL. ACCEPTS DS NAME AND VIEW IT.       
 * AUTHOR    : OFER                                                     
 * DATE      : 15/12/03                                                 
 * HOW TO USE:                                                         
 *           :                                                         
 *------------------------------------------------------------------*/ 
                                                                       
ARG DS                                                                 
                                                                       
DS = STRIP(DS,"B","'")                                                 
DS = STRIP(DS)                                                         
                                                                       
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"                                 
ADDRESS ISPEXEC "VIEW DATASET('"DS"')"                                 
                                                                       
EXIT                                                                   
                                                                       


O.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top