Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ISPF Selection Panel - Mixing selections and data

Status
Not open for further replies.

tpms2000

Programmer
Jan 20, 2003
19
0
0
EU
Apologies for the long winded question re ISPF panels -
THE BACKGROUND TO THE PROBLEM:
Part of a basic selection panel:
)BODY
+ - - - - Handover Log - - - -
} Option ===>_ZCMD +
+
+ 1. View the Log file
+ 2. Add an entry to the Log file
+ 3. Remove the following entry from the Log file:$Z +
+
+ Select an option or "Q" to Quit
)INIT
.ZVARS = '(PREF)'
)PROC
&ZSEL = TRANS(TRUNC(&ZCMD,'.')
1,'CMD(%HANDOVER,1)'
2,'CMD(%HANDOVER,2)'
3,'CMD(%HANDOVER,3,&pref)'
Q,'EXIT'
' ',' '
*,'?')
)END
If option 3 is selected, Rexx procedure HANDOVER checks that a three digit number has been entered in field PREF:
At the start of the Rexx is:
ARG action
later on:
Parse var action 3 logrefno /* i.e. extract & validate panel variable PREF */
If Datatype(logrefno) \ = "NUM" | Length(logrefno) \= 3 Then
do
Zerrsm = "Invalid Ref; Press F1"
Zerrlm = "The Log file entry must be three digits"
Zerralrm = "YES"
Address ISPEXEC "SETMSG MSG(ISRZ002)"
Signal REXX_EXIT
end
Return

THE PROBLEM:
Can I get this panel to -
a) clear out field PREF when the panel is first displayed, i.e. selected from an earlier panel and also put the cursor on the command line
b) clear out field PREF if, after running Rexx HANDOVER, the error message is not equal to the setting of Zerrsm above, i.e. Zerrsm contains another message such as “Edit successful” and, again, also put the cursor on the command line
c) retain field PREF with its invalid setting if the error message is equal to the setting of Zerrsm above but this time the cursor is on the field in error
or,
should selection panels be just that - a menu where the only option is to select a number or letter?
 
It _could_ be done in panel language, but it would be lots easier to handle it in REXX. When the application code determines that the value of PREF is no longer required, blank it out.

Ditto for loading the cursor: have the REXX code set a field name to pass back to the panel's '.CURSOR' spec.
 
I agree - this is what I would have done ordinarily except the selection panel is called from an earlier panel rather than a Rexx. If I code in )INIT - pref = ' ', it's always cleared out when I come back to the panel from the Rexx even if I try and put a condition in )REINIT e.g. to check for the value of ZERRSM or ZERRMSG
 
Please try the following logic. I apologize that I could not try it since I am not connected to the mainframe.

Firstly, modify your exec as follows.

ARG action
macflag = 1
errflag = 0
Parse var action 3 logrefno /* i.e. extract & validate panel variable PREF */
If Datatype(logrefno) \ = "NUM" | Length(logrefno) \= 3 Then
do
Zerrsm = "Invalid Ref; Press F1"
Zerrlm = "The Log file entry must be three digits"
Zerralrm = "YES"
Address ISPEXEC "SETMSG MSG(ISRZ002)"
errflag = 1
Signal REXX_EXIT
end
Return

Then, vput the 2 new variables into the profile pool using the following statement.

"ispexec vput (macflag errflag) profile"

Now, add the following code into the )INIT section of panel definition.
vget (macflag errflag)
if (&macflag = 1)
if (&errglag = 0)
&pref = ' '
.cursor = ZCMD
else
.cursor = &pref
else
.cursor = ZCMD
&pref = ' '

-Mainframestudent.
 
Thanks for the replies - much appreciated.They guided me to an easy solution.
Panel_a sets AFLAG to Y and VPUTs AFLAG
Panel_b VGETs AFLAG. If it = Y, set it to N, VPUT it and clear out the field. So the field is only ever cleared if I come at it from Panel_a.
Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top