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: 10292
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: 674
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. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx to create a tso command Bharath Vikraman CLIST & REXX 1 Tue Aug 08, 2017 3:32 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Default Message in Rexx cvnlynn CLIST & REXX 9 Wed Aug 02, 2017 12:38 am
No new posts Calling CLIST through job and REXX Sahasra K CLIST & REXX 19 Tue Aug 01, 2017 10:25 am


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