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

How to use global veriable in rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vkp321

New User


Joined: 05 Jan 2009
Posts: 56
Location: Dublin

PostPosted: Fri Feb 03, 2012 10:22 am
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Feb 03, 2012 1:00 pm
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
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: 792
Location: Pennsylvania

PostPosted: Fri Feb 03, 2012 7:06 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
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
Search our Forums:

Back to Top