MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Set variables for a Rexx

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Wed Sep 14, 2011 8:32 am    Post subject: Set variables for a Rexx Reply with quote

I have several Rexx routines that need to use the same variables. I want to have a central place for these variables so that they only have to be changed once and are external to the other routines. Maybe somebody has a better solution, but this is how I did it:

The calling Rexx routines use this:
call 'FAHRVARS' /* get fahrplan variables for this system */
do queued()
pull fpvar
interpret fpvar
end

The variables routine looks like this:
/* Rexx Fahrplan Variables - modify! */
queue "fplvw = '49'" /* Country code 49 D, 41 CH, 32 B */
queue "fpsid = 'Z9P1'" /* System ID, compared if sysid = sid */
queue "fpcll = 'CNTL'" /* LLQ for Cntl data sets */
queue "fpdll = 'DOKU'" /* LLQ for Doku data sets (document.) */
queue "fphll = 'HELP'" /* LLQ for Help data sets */
exit


Any better ideas?
Back to top
View user's profile Send private message Visit poster's website
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Sep 14, 2011 9:18 am    Post subject: Reply with quote

What sort of environment are you running these exec's in? TSO? ISPF? Batch? MVS? Some other environment (Netview, SA, OPS/MVS, Mainview)?

I'm thinking, if ISPF Services are available, you could use the ISPF VPUT and VGET Services, and store them in the PROFILE pool, to share variables.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Sep 14, 2011 12:18 pm    Post subject: Reply with quote

warp5,


Check if this is of any use

REXX Global Variables

or

GLOBALV (REXX)

GLOBALV GET (REXX)

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Thu Sep 15, 2011 3:09 am    Post subject: Reply with quote

Thanks for your answers. Both solutions would work. Kolusu, the solution you suggested is interesting, but I prefer using standard IBM tools if possible. Superk, I did not think of using that possibility, even though I am in an ISPF environment and use VPUT in my routines already. I just did some testing and have decided to stay with the solution I have. The main reason is that it is a clear and easy to use way to do what I need. I feel that the vput solution is a lot more complicated to program seeing as how the number and names of the variables can change. Thanks again for your suggestions.
Back to top
View user's profile Send private message Visit poster's website
asr2
Beginner


Joined: 25 Jun 2011
Posts: 26
Topics: 4
Location: Germany

PostPosted: Fri Sep 23, 2011 4:54 pm    Post subject: Reply with quote

There is one very easy solution to the problem with changes to the names of global variables used with VPUT, namely, have a global variable that contains the names of the global variable.

For example:

VGET '$VN'
VGET '('$VN')'

Where $VN contains, for example, V1 V2, where V1 V2 are the names of the actual global variables.

I have used this technique in a number of applications, some of which contain hundreds of global variables. The only maintenance involves defining the $VN content; this I do in a central function.
Back to top
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Mon Sep 26, 2011 1:37 am    Post subject: Reply with quote

Asr2, thanks for your input. I remember doing that somewhere in one of my routines, but I have written so many that I do not know where that is bonk Wink
Maybe at a later time (when I have more time) I will look into this again, but right now I am content with the solution I am using because it is so clear and easy to read and process. I am distributing the routines to another location where they will have to modify these values, that is why it is important that it is easy to read and change. I will also test the solutions to see how they compare in resources usage.
Back to top
View user's profile Send private message Visit poster's website
asr2
Beginner


Joined: 25 Jun 2011
Posts: 26
Topics: 4
Location: Germany

PostPosted: Mon Sep 26, 2011 5:53 am    Post subject: Reply with quote

Another, somewhat unusual but easy, way of setting such variables is to use the )SET statement with ISPF file tailoring. With FTINCL, the current variables are fetched and set. This also has the advantage that ISPF file tailoring services, such as variable substitution, can also be used.

Regards
Tony
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group