View previous topic :: View next topic
|
Author |
Message |
Domenic Ailati
New User
Joined: 11 Apr 2017 Posts: 4 Location: USA
|
|
|
|
Hi,
I would like to be able to press a function key on an ISPF panel, then have a specific text string sent at the cursor position.
The cursor would have to be on an input enabled field, obviously.
The function key would only be pressed if it's appropriate to do so as determined by the user.
An example use case would be:
Let's say a user is on 1.3.4 (Data Set List Utility panel), "Dsname Level" field and they press a function key. The function key would invoke a rexx program which would then send a specific text literal at the current cursor position.
I figured out how to assign the rexx program to a function key, and how to get the current cursor position, but i cannot seem to find any information on how to send text at the cursor position.
Code: |
/* REXX */
address ispexec "vget (zscreeni screenc) SHARED"
say "cursor location=" zscreenc
say "screen image ="
say zscreeni
exit
|
Could someone please provide further guidance or point me in the right direction.
Thanks |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
Back to top |
|
|
Domenic Ailati
New User
Joined: 11 Apr 2017 Posts: 4 Location: USA
|
|
|
|
Thanks for the response, but I believe there's been a misunderstanding.
I'm not in the ISPF editor; thus, an edit macro or ISREDIT would not be applicable in this situation.
From what I've read and have shown in the code, I would need to use the ISPF environment command processor, ISPEXEC. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
See the .CURSOR statememt in the 'ISPF Dialog Developer's Guide and Reference' manual section 'Using ISPF control variables'
Have something like this:
&CNAME = .CURSOR
in the panel )PROC section.
Then you should know the variable name where the cursor is, and you can assign a value to the variable.
Though I must admit I haven't tried it myself. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2545 Location: Silicon Valley
|
|
|
|
(I am not working anymore, so cannot verify if this works in the data set list panel).
1. I found this to be useful... you can set a PF key to be 'NRETRIEV', which stands for 'name retrieve'. ISPF keeps a history of the names you have used and pressing the NRETRIEV key pulls names off of the stack in a LIFO order. To use, put the cursor in the name field and press the NRETRIEV key. The data set name is put in name field. It works in the browse and edit data set name panels.
If it does not work, let me know and I will open a requirement on IBM's developerworks site.
2. If you need to do this using your own logic, I suggest using a customized panel as Willy suggests.
a.
Code: |
/*in the panel )INIT section. */
IF (&myretrev = &z) /* unassigned */
&myretrev = 0)
IF (&myretrev = 1)
.CURSOR = DSNAME
&DSNAME = &MYDSN
|
b.
Code: |
/*in the panel )PROC section. */
&CNAME = .CURSOR
IF (&CNAME = DSNAME and ZCMD = MYCMD)
&MYDSN = 'pedro.jcl.cntl' /*or call your rexx here */
&myretrev = 1
Else
&myretrev = 0
|
|
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Here it seems we have a newbie who's trying to invent some kind of macro facility.
Let's ask the following questions:
- What happens if, no, make that "when", the user just presses the PF key willy-nilly? Users are idiots and "if it's appropriate to do so as determined by the user" will never apply...
- How does the PF key invoked exec know on which panel it is?
- How would the exec determine that the cursor is on an input field?
- How would the exec figure out the actual ISPF variable name used for that field on the panel?
'nuff said...
Anyone wants to bet against this topic going nowhere? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2545 Location: Silicon Valley
|
|
|
|
Quote: |
Anyone wants to bet against this topic going nowhere? |
Please do not discount my advice regarding NRETRIEV. It is a wonderful feature. Everyone should try it. (fyi. I asked for this feature sometime in the 1990's. whoot!) |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Pedro wrote: |
Quote: |
Anyone wants to bet against this topic going nowhere? |
Please do not discount my advice regarding NRETRIEV. It is a wonderful feature. Everyone should try it. (fyi. I asked for this feature sometime in the 1990's. whoot!) |
I've set PF6 to NRETRIEV on every panel, and PF5 to that other wonderful piece of magic, AUTOTYPE, almost from the moment they came into existence.
But this topic will still go nowhere. |
|
Back to top |
|
|
Domenic Ailati
New User
Joined: 11 Apr 2017 Posts: 4 Location: USA
|
|
|
|
Thank you for the responses.
Quote: |
1. I found this to be useful... you can set a PF key to be 'NRETRIEV', which stands for 'name retrieve'. ISPF keeps a history of the names you have used and pressing the NRETRIEV key pulls names off of the stack in a LIFO order. To use, put the cursor in the name field and press the NRETRIEV key. The data set name is put in name field. It works in the browse and edit data set name panels. |
Tried the suggestion on the dsname field on data set list panel. It worked. I see the reference to REFLIST as the names are popped from the stack in the top right hand corner. thx.
----
Quote: |
What happens if, no, make that "when", the user just presses the PF key willy-nilly? Users are idiots and "if it's appropriate to do so as determined by the user" will never apply... |
Yes, this may happen. The macro is for personal use. You are right, I am an idiot sometimes and do make mistakes often, but I learn from failure.
Quote: |
How does the PF key invoked exec know on which panel it is? |
Yes, I don't want the PF key to know which panel it's on.
Quote: |
How would the exec determine that the cursor is on an input field? |
Yes, exec does not need to know. I would make the decision.
Quote: |
How would the exec figure out the actual ISPF variable name used for that field on the panel? |
Yes, after reading through the relevant sections in the ISPF Dialog Developer's Guide as suggested by Willy, I realized that some further head scratching would be necessary.
Yes, from a certain perspective, skepticism would be understandable
Quote: |
Anyone wants to bet against this topic going nowhere? |
Wrong, there's more than one way to skin a cat. I wrote a vbscript to do what I had envisioned. Mission accomplished.
- One regret I have is not explaining myself more clearly in my original post, but on the other hand I got a lot of invaluable food for thought. |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
Here is some more food.
Did you look at the ZSCREENI and ZSCREENC variables? ZSCREENI contains the screen image, and ZSCREENC gives you the cursor position. That is what I use for all of my 'screen scrapes', because it works on *any* ISPF panel regardless of whether the field is input enabled or not. It takes a bit of work to parse ZSCREENI, but it is not that difficult. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Domenic Ailati wrote: |
I wrote a vbscript to do what I had envisioned. Mission accomplished. |
And that runs on z/OS using z/OS PF keys? Somehow I don't think so...
For what it's worth, I've got a dual function (edit macro / TSO command) bit of REXX code that can be used to edit ISPF clipboards from within other edit macros, or access the ISPF clipboards from outside the ISPF editor. It actually modifies a panel on the fly!
Now try that with VBS on Windoze... |
|
Back to top |
|
|
|