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

passing stem variable with VPUT/VGET from/to macro


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

New User


Joined: 27 Feb 2021
Posts: 31
Location: Germany

PostPosted: Sat Jul 03, 2021 12:03 pm
Reply with quote

Hi guys,

I am working on a REXX program in which I have to use an edit macro.
I can pass regular variable between my REXX and my Edit Macro, but I cannot pass stem variables like VAR.I.
so far I tried

Code:
 "ISPEXEC VGET "VAR.I""

and
Code:
 "ISPEXEC VGET "VAR.""

and
Code:
 "ISPEXEC VGET "VAR""

but non is correct.
Any ideas?

Thanks in advance,
Mahsa Rouzkhatouni
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10801
Location: italy

PostPosted: Sat Jul 03, 2021 12:18 pm
Reply with quote

just curious ,

how did you do the VPUT icon_question.gif
Back to top
View user's profile Send private message
Mahsa Rouzkhatouni

New User


Joined: 27 Feb 2021
Posts: 31
Location: Germany

PostPosted: Sat Jul 03, 2021 12:31 pm
Reply with quote

Quote:
how did you do the VPUT icon_question.gif


In my REXX I specify the variables like this:
Code:
 "ISPEXEC VPUT VAR1"


and then in the macro I pull it this way:
Code:
 "ISPEXEC VGET "Var1""


but this works for regular variables, I can't figure out how to pass stem variables.
[/quote]
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 495
Location: Denmark

PostPosted: Sat Jul 03, 2021 1:17 pm
Reply with quote

You can't.
There are various methods:
Install program REXXGBLV from Use [URL] BBCode for External Links file 669 or harders-jensen.com, the program allows you to store and retrieve any kind of REXX variables.
Install program STEMPUSH from Use [URL] BBCode for External Links file 411, the program allows you to store and retrieve REXX stems.
Copy all stem.n variable to stemn and VPUT them, i.e copy CAR.22 to CAR22. There are of course limitations to this method and it requires some coding.
Make one big string with the stem variables interspersed by a delimiter, then VPUT the string var. Again this requires some coding and a ISPF variable is limited to 32K size.
Make one big string with the stem variables interspersed by a delimiter, then use the string as the parameter to the macro.
Back to top
View user's profile Send private message
Mahsa Rouzkhatouni

New User


Joined: 27 Feb 2021
Posts: 31
Location: Germany

PostPosted: Sat Jul 03, 2021 1:26 pm
Reply with quote

Quote:
There are various methods:


Yeah thanks,
Now that I know there is no standard statement for that, I managed to make a loop in my REXX and assign the stem variable to a regular variable then use it in the macro.
It works fine
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 495
Location: Denmark

PostPosted: Sat Jul 03, 2021 1:42 pm
Reply with quote

Glad that you found a solution. Here is a demo of using one string var:
Code:
 /* make demo stem */
 car.1='Opel'                   
 car.2='Ford'                   
 car.3='Mazda'                   
 car.4='Peugeot'                 
 car.5='Tesla'                   
 car.0=5                     
 /* pack */   
 cars=''                         
 do n=1 to car.0                 
   cars=cars || car.n || '\'     
 end                             
 drop car.                       
 /* unpack */     
 do n=1 to 9999 while cars<>''   
   parse var cars car.n '\' cars
 end                             
 car.0=n-1   
Back to top
View user's profile Send private message
Mahsa Rouzkhatouni

New User


Joined: 27 Feb 2021
Posts: 31
Location: Germany

PostPosted: Sat Jul 03, 2021 1:45 pm
Reply with quote

Quote:
Here is a demo of using one string var:


Nice, thanks
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 Merge a variable number of records fr... DFSORT/ICETOOL 5
No new posts Trying to reference a javascript glob... CLIST & REXX 7
No new posts DECIMAL HOST VARIABLE OR PARAMETER 14... DB2 7
This topic is locked: you cannot edit posts or make replies. Passing a field name to COBOL program COBOL Programming 10
No new posts FILE STATUS - 39 ON VARIABLE LENGTH V... COBOL Programming 2
Search our Forums:

Back to Top