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
 

 

How to use global veriable in rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Vkp321

New User


Joined: 05 Jan 2009
Posts: 35
Location: Pune

PostPosted: Fri Feb 03, 2012 10:22 am    Post subject: How to use global veriable in rexx
Reply with quote

Hi,

Rexx program A is calling program B. Program A is passing three varibles to program B. Program B is manipulating these three variable, I need the value of these three variables in Program A, I tried below code but it has not worked. Please help

A
/* REXX */

call B v1 v2 v3

say v1 v2 v3


B
/* REXX */
ARG v1 v2 v3
v1= 1
v2=2
v3=3
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10257
Location: italy

PostPosted: Fri Feb 03, 2012 1:00 pm    Post subject: Reply to: How to use global veriable in rexx
Reply with quote

in REXX there is no provision for passing <global> <tokens> between <external> procedures

for procedures inside the same source member read about the EXPOSE clause

if Your rexx runs under the ISPF environment You might use VPUTs and VGETs

if your organization allows the use of freeware applications You might check
http://www.btinternet.com/~ashleys/fadh_globalv.htm

or write Your own, not that much complicated icon_cool.gif
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 662
Location: Pennsylvania

PostPosted: Fri Feb 03, 2012 7:06 pm    Post subject:
Reply with quote

This call/return structure worked for me.

Code:

/* REXX PROGRAM A*/
V1 = 'A-VALUE1'
V2 = 'A-VALUE2'
V3 = 'A-VALUE3'
CALL "B" V1 V2 V3
PARSE VAR RESULT V1 V2 V3
SAY 'BACK IN PROGRAM A VALUES -' V1 V2 V3
EXIT

/* REXX PROGRAM B */
ARG V1 V2 V3
SAY 'IN PROGRAM B VALUES -' V1 V2 V3
V1 = 'B-VALUE1'
V2 = 'B-VALUE2'
V3 = 'B-VALUE3'
EXIT V1 V2 V3
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 -> CLIST & REXX 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
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
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


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