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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am


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