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
 

 

NATURAL trick: Calling REXX directly from within NATURAL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
View previous topic :: :: View next topic  
Author Message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Jan 17, 2006 12:20 pm    Post subject: NATURAL trick: Calling REXX directly from within NATURAL
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    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts Reg:Displaying the particular month o... bhavana yalavarthi All Other Mainframe Topics 4 Sat Jul 08, 2017 8:13 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts REXX WTO for console message bipinpeter CLIST & REXX 6 Tue Jun 27, 2017 3:56 pm


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