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 

provide an editor window from within 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
chuck
Beginner


Joined: 30 Nov 2007
Posts: 25
Topics: 11

PostPosted: Wed Nov 23, 2022 3:30 pm    Post subject: provide an editor window from within a rexx Reply with quote

Hi
This seems to be a fairly obvious use case but all the googling I did just keeps returning pages on edit macros.

I have create a Rexx script where the user enters a list of elements in a dataset and I open the dataset and read all the members into a stemvariable and process the contents of the stem variable one at a time.

But I wanted to provide additional flexibility where the user doesn't have to create a dataset and edit it to enter the values and save it and so on in advance of running the script.
Instead when the user runs the script, from within the script I want to provide an ISPF edit session to the user to enter the list of elements, one on each line and at the end, hits F3.
The script continues executing. It should process the entered values one by one just like when it read it from the preexisting dataset.

i have a hazy feeling some kind of temp datasets are involved but like I said can't seem to find anything online or even on this forum to help, but I am happy to stand corrected.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Nov 23, 2022 4:37 pm    Post subject: Re: provide an editor window from within a rexx Reply with quote

chuck wrote:
Hi
Instead when the user runs the script, from within the script I want to provide an ISPF edit session to the user to enter the list of elements, one on each line and at the end, hits F3.


Chuck,

You can do it with a VPUT in your REXX routine and a VGET in the edit macro that makes the changes

https://www.ibm.com/docs/en/zos/2.5.0?topic=services-vgetretrieve-variables-from-pool-profile-system-symbol


Alternatively you can use PULL and PUSH

https://www.mvsforums.com/helpboards/viewtopic.php?p=2737#2737
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chuck
Beginner


Joined: 30 Nov 2007
Posts: 25
Topics: 11

PostPosted: Wed Nov 23, 2022 4:56 pm    Post subject: Re: provide an editor window from within a rexx Reply with quote

chuck wrote:
Hi
This seems to be a fairly obvious use case but all the googling I did just keeps returning pages on edit macros.

I have create a Rexx script where the user enters a list of elements in a dataset and I open the dataset and read all the members into a stemvariable and process the contents of the stem variable one at a time.

But I wanted to provide additional flexibility where the user doesn't have to create a dataset and edit it to enter the values and save it and so on in advance of running the script.
Instead when the user runs the script, from within the script I want to provide an ISPF edit session to the user to enter the list of elements, one on each line and at the end, hits F3.
The script continues executing. It should process the entered values one by one just like when it read it from the preexisting dataset.

i have a hazy feeling some kind of temp datasets are involved but like I said can't seem to find anything online or even on this forum to help, but I am happy to stand corrected.



I think I might have got something.

Code:
"ALLOC DD(SYSIN) NEW REU UNIT(VIO) RECFM(F B) LRECL(80)"
"ISPEXEC LMINIT DATAID(MYEDIT) DDNAME(SYSIN)"
"ISPEXEC EDIT DATAID(&MYEDIT) "

/*user has opportunity to enter data here*/

"EXECIO * DISKR SYSIN (FINIS STEM STEMVAR."

/*do similar processing to like when you read from a regular dataset*/


Thoughts?
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 618
Topics: 172
Location: Stockholm, Sweden

PostPosted: Thu Nov 24, 2022 5:48 am    Post subject: Reply with quote

I was curious with your suggestion (never seen that before).
My question is, what value did you have in MYEDIT (or is the idea that myedit resolves to 'your_userid.MYEDIT', and if so, is that a file that already exists).

When I ran it as-is from your suggestion, I got
Quote:

ISRE177

Missing EDIT/VIEW parm
Either data set, DATAID, or z/OS UNIX file pathname parameter is
required.





Current dialog statement:
EDIT DATAID()

Is there a bunch of code you've left out ?
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
chuck
Beginner


Joined: 30 Nov 2007
Posts: 25
Topics: 11

PostPosted: Fri Nov 25, 2022 10:46 am    Post subject: Reply with quote

misi01 wrote:
I was curious with your suggestion (never seen that before).
My question is, what value did you have in MYEDIT (or is the idea that myedit resolves to 'your_userid.MYEDIT', and if so, is that a file that already exists).

When I ran it as-is from your suggestion, I got
Quote:

ISRE177

Missing EDIT/VIEW parm
Either data set, DATAID, or z/OS UNIX file pathname parameter is
required.





Current dialog statement:
EDIT DATAID()

Is there a bunch of code you've left out ?


Not really. I notice that I left out the /*REXX*/ at the top, but I assume you added that, otherwise you get a different error.

As it stands, if you execute that script it will open an ISPF editor session and let you enter stuff. If you hit F3, it does nothing. You can add these lines to the script to echo what you typed in during the edit session

Code:
do i = 1 to stemvar.0
   say stemvar.i
end
Back to top
View user's profile Send private message
chuck
Beginner


Joined: 30 Nov 2007
Posts: 25
Topics: 11

PostPosted: Fri Nov 25, 2022 10:47 am    Post subject: Re: provide an editor window from within a rexx Reply with quote

kolusu wrote:
chuck wrote:
Hi
Instead when the user runs the script, from within the script I want to provide an ISPF edit session to the user to enter the list of elements, one on each line and at the end, hits F3.


Chuck,

You can do it with a VPUT in your REXX routine and a VGET in the edit macro that makes the changes

https://www.ibm.com/docs/en/zos/2.5.0?topic=services-vgetretrieve-variables-from-pool-profile-system-symbol


Alternatively you can use PULL and PUSH

https://www.mvsforums.com/helpboards/viewtopic.php?p=2737#2737


Cool, I will check these out, thanks.
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