Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 10360
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: 687
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
No new posts Rexx to send an email without SMTP Se... upendrasri All Other Mainframe Topics 6 Sun Nov 19, 2017 7:59 pm
This topic is locked: you cannot edit posts or make replies. ISREDIT Macro is not returning back t... nico_neoz CLIST & REXX 21 Sat Nov 18, 2017 7:40 pm
No new posts REXX LISTDSI () SMSINFO is not working upendrasri CLIST & REXX 4 Fri Nov 17, 2017 11:33 am
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 4 Wed Nov 15, 2017 4:27 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us