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 

Passing STEM variable as argument in 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
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Tue Sep 20, 2005 2:02 am    Post subject: Passing STEM variable as argument in REXX Reply with quote

Hi

I am calling one REXX program from another one.

Can I pass STEM variable as an argument to the called program.

I have a variable as follows in my calling program...

name.0 = 3
name.1 = "Sri"
name.2 = "Raj"
name.3 = "Rams"

I need to pass all the names to called program as argument.

Will "CALL PGM2(NAME.)" statment will do the purpose?

How should I receive the same in the called program.

Thanks for the help...

Sridhar P
Back to top
View user's profile Send private message
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Tue Sep 20, 2005 2:23 am    Post subject: Reply with quote

In the called program Arg() will give you the number of arguments, you could play with it.

Code:

do i=1 to Arg()
   yourstem.i = arg(i)
   end i


hth.
Back to top
View user's profile Send private message
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Tue Sep 20, 2005 2:36 am    Post subject: Reply with quote

Hi

But I dont know the format - how to pass a STEM variable as argument to a called program and how should I receive the same in called program.

Thanks
Sridhar P
Back to top
View user's profile Send private message
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Tue Sep 20, 2005 3:16 am    Post subject: Reply with quote

several ways:
-writing/reading a file
-using the stack (queue in call-er /pull in call-ed)
-using arguments:
address tso "AAA" arg1 arg2
parse value AAA(arg1 arg2) with RC fieldback1 fieldback2...
x=AAA(arg1 arg2)
Back to top
View user's profile Send private message
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Tue Sep 20, 2005 3:41 am    Post subject: Reply with quote

I know these options...

What I want to know is...

Is there a way that I pass the stem variable as an argument to the called program like

CALL CALLEDPGM(NAME.)

where

NAME.0 = 3
NAME.1 = "Sri"
NAME.2 = "Raj"
NAME.3 = "Rams"

and receive the same in the called program using ARG NAME.
Back to top
View user's profile Send private message
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Tue Sep 20, 2005 4:30 am    Post subject: Reply with quote

oooooooop sorry.

I don't know, I just treat it every item as a single argument.
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Tue Sep 20, 2005 4:46 am    Post subject: Reply with quote

psridhar, I think the best plan is just to try it.

Cheers,
Merv
_________________
The day you stop learning the dinosaur becomes extinct
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