Is is possible to read a the Cursor position from an ISPF Panel ?
I have a Panel that has multiple variables (L0 - L48) which are populated with values from within a REXX.
I would like the user to be able to position the Cursor on the first character of any of the fields and press enter and have the Cursor position read.
I will be able to determine the value of the field by Cursor position (row,column).
Read cursor position from ISPF Panel
- Pedro
- Posts: 686
- Joined: Thu Jul 31, 2008 9:59 pm
- Skillset: ISPF
- Referer: google
- Location: Silicon Valley
Re: Read cursor position from ISPF Panel
You can use ISPF control variables to get the values you need. See the ISPF Dialog Developer's Guide and Reference
Code: Select all
)PROC
&mycursor = .CURSOR /* name of field where the cursor is */
&mycsrpos = .CSRPOS /* offset within the field where the cursor is */
Pedro Vera
- Pedro
- Posts: 686
- Joined: Thu Jul 31, 2008 9:59 pm
- Skillset: ISPF
- Referer: google
- Location: Silicon Valley
Re: Read cursor position from ISPF Panel
re: "determine the value of the field"
Something like this:
Something like this:
Code: Select all
&myvalue = TRANS(&mycursor
'L0', &L0
'L1', &L1
'L2', &L2
'L3', &L3)
Pedro Vera
-
- Posts: 27
- Joined: Fri Dec 09, 2022 6:59 pm
- Skillset: CA-7, JCL, SORT, Roscoe, TSO, REXX
- Referer: just found you on the Internet
Re: Read cursor position from ISPF Panel
Thanks Pedro...I had t get pretty creative with the TRANSLATE.
Next issue...my REXX drives through 3 Panels...we can call them PANEL1, PANEL2 and PANEL3 and they are used sequentially in the respective order, I need to be able to "go backward" (i.e. from PANEL3 to PANEL2 and from PANEL2 to PANEL1) and this is controlled via PF1...however when I am (for example) in PANEL2 and press PF1 I get :
Scenario #1 (REXX executed from SDSF within ISPF) "ISPF Tutorial Error Panel Display" and the following error :
The previous panel displayed has either a blank or a
help panel reference that is not valid. The application
displaying this panel has not defined a panel for a
tutorial table of contents. (The ZHTOP variable was not
set.) Notify your systems programmer.
pressing PF3 or entering END does return me to PANEL2...pressing PF3 (or END) again and I get :
ISF039I ERROR PROCESSING ISPF VDEFINE RC=12: Panel 'ISFPNO41' error
ISF039I Panel not found.
and the ISPF processor abends
Scenario #2 (REXX executed from ISPF Primary Option Menu) taken to "Table of Contents" in "ISPF Program Development Facility Tutorial"
How do I override PF1 when the REXX is executed to perform my instruction which is a SIGNAL to an internal LABEL...will this resolve Scenarion #1 ??
Next issue...my REXX drives through 3 Panels...we can call them PANEL1, PANEL2 and PANEL3 and they are used sequentially in the respective order, I need to be able to "go backward" (i.e. from PANEL3 to PANEL2 and from PANEL2 to PANEL1) and this is controlled via PF1...however when I am (for example) in PANEL2 and press PF1 I get :
Scenario #1 (REXX executed from SDSF within ISPF) "ISPF Tutorial Error Panel Display" and the following error :
The previous panel displayed has either a blank or a
help panel reference that is not valid. The application
displaying this panel has not defined a panel for a
tutorial table of contents. (The ZHTOP variable was not
set.) Notify your systems programmer.
pressing PF3 or entering END does return me to PANEL2...pressing PF3 (or END) again and I get :
ISF039I ERROR PROCESSING ISPF VDEFINE RC=12: Panel 'ISFPNO41' error
ISF039I Panel not found.
and the ISPF processor abends
Scenario #2 (REXX executed from ISPF Primary Option Menu) taken to "Table of Contents" in "ISPF Program Development Facility Tutorial"
How do I override PF1 when the REXX is executed to perform my instruction which is a SIGNAL to an internal LABEL...will this resolve Scenarion #1 ??
- Pedro
- Posts: 686
- Joined: Thu Jul 31, 2008 9:59 pm
- Skillset: ISPF
- Referer: google
- Location: Silicon Valley
Re: Read cursor position from ISPF Panel
The convention on ISPF is for PF1 to show help information. I think it is easier to use different keys than to try to override PF1.
And it probably makes your application more robust to provide help panels. You can set control variable .HELP in your )INIT section to set the name of the help panel.
And it probably makes your application more robust to provide help panels. You can set control variable .HELP in your )INIT section to set the name of the help panel.
Pedro Vera
- Pedro
- Posts: 686
- Joined: Thu Jul 31, 2008 9:59 pm
- Skillset: ISPF
- Referer: google
- Location: Silicon Valley
Re: Read cursor position from ISPF Panel
I have two separate suggestions.
1. Use PF10 and PF11. Those keys are normally set to LEFT and RIGHT. In the )PROC section, check &ZCMD for LEFT or RIGHT and then set &ZCMD to NEXT or PREV (otherwise you probably get some other error message). In the rexx program, check &ZCMD and process accordingly.
2. Have two output only fields, NEXT and PREV, near the top of the panel. When the user double clicks on one of them, check the cursor position and then provide logic in the rexx program to take it to the next panel.
1. Use PF10 and PF11. Those keys are normally set to LEFT and RIGHT. In the )PROC section, check &ZCMD for LEFT or RIGHT and then set &ZCMD to NEXT or PREV (otherwise you probably get some other error message). In the rexx program, check &ZCMD and process accordingly.
2. Have two output only fields, NEXT and PREV, near the top of the panel. When the user double clicks on one of them, check the cursor position and then provide logic in the rexx program to take it to the next panel.
Pedro Vera
-
- Posts: 27
- Joined: Fri Dec 09, 2022 6:59 pm
- Skillset: CA-7, JCL, SORT, Roscoe, TSO, REXX
- Referer: just found you on the Internet
Re: Read cursor position from ISPF Panel
yes, I can change the PF key, but this REXX is being written to replace a Roscoe RPF that has been in use for MANY years and my thought was to make the transition as transparent as possible...PF1 serves that purpose in the RPF.
is there a convenient way to override PFkeys ?...because I have all of mine (all 24) in use.
I do plan or eventually getting to HELP panels as they too are part of the current RPF...just one task at a time.
As for the NEXT and PREV...I will most likely use that for multiple screen panels (i.e. PANEL2/PAGE1...PANEL2/PAGE2).
Also...how do I paste a screen shot in a reply here ?
is there a convenient way to override PFkeys ?...because I have all of mine (all 24) in use.
I do plan or eventually getting to HELP panels as they too are part of the current RPF...just one task at a time.
As for the NEXT and PREV...I will most likely use that for multiple screen panels (i.e. PANEL2/PAGE1...PANEL2/PAGE2).
Also...how do I paste a screen shot in a reply here ?
- Pedro
- Posts: 686
- Joined: Thu Jul 31, 2008 9:59 pm
- Skillset: ISPF
- Referer: google
- Location: Silicon Valley
Re: Read cursor position from ISPF Panel
re: .how do I paste a screen shot in a reply here?
I think, just use a text copy of the screen then use the 'Code' tags here and paste in the screen copy.
I think, just use a text copy of the screen then use the 'Code' tags here and paste in the screen copy.
Pedro Vera
-
- Posts: 27
- Joined: Fri Dec 09, 2022 6:59 pm
- Skillset: CA-7, JCL, SORT, Roscoe, TSO, REXX
- Referer: just found you on the Internet
Re: Read cursor position from ISPF Panel
yep...that works
- Pedro
- Posts: 686
- Joined: Thu Jul 31, 2008 9:59 pm
- Skillset: ISPF
- Referer: google
- Location: Silicon Valley
Re: Read cursor position from ISPF Panel
is there a convenient way to override PFkeys ?
fyi. pf keys are somewhat controversial.
It is common for each application to create its own application pool. Use the ISPF SELECT service to launch your rexx program:
Code: Select all
Address ISPEXEC "SELECT CMD(myrexx) NEWAPPL(myap)"
Where 'myap' can be up to four characters of your choosing. To avoid conflicts with IBM, start with letters K-Z.
Using your own applid creates an empty variable pool, including your PFkeys. In this way, you can assign values to ISPF variable ZPF10 from your rexx, for example. Also, you do not have to worry about colliding with other programs defining a variable with a common name like 'dsname'.
It is somewhat controversial because users get annoyed by having to make their customizations in a bunch of places.
Pedro Vera
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Call REXX dsn "independently" from ispf panel
by RazVorox » Wed Jun 07, 2023 11:32 am » in CLIST & REXX - 2
- 1835
-
by willy jensen
View the latest post
Wed Jun 07, 2023 1:23 pm
-
-
- 2
- 1365
-
by RazVorox
View the latest post
Tue Dec 05, 2023 11:06 am
-
-
Commit issued without hold and without close cursor statemen
by ravi11081992 » Sat Jan 22, 2022 2:42 pm » in DB2 - 2
- 2253
-
by engh
View the latest post
Tue Sep 20, 2022 6:07 pm
-
-
- 6
- 6288
-
by Mainframe_Dev
View the latest post
Mon Jan 30, 2023 1:06 am
-
- 3
- 7913
-
by socker_dad
View the latest post
Thu Jan 28, 2021 4:13 am