Page 1 of 1

ISPF Panel Error Handling override

PostPosted: Thu Feb 23, 2012 12:04 pm
by Balamurugan21
Hi All ,

i am new to ISPF panels & REXX , so i apologise if this is a basic question....

i have a ISPF panel where i need to key some details & based on the data received i would process them...

I have a generic error traping module to be executed if any unexpected inputs are keyed.

Eventhough F3 is pressed in the panel , the program enters error trapping module instead of performing tasks mentioned under (KEYPRESS=PF03) . Can any one guide me where i am going wrong.

Below is my sample code..

SIGNAL ON ERROR NAME TRAP

PANELLIB='XXX.SAMPLE.PANEL'
ADDRESS ISPEXEC
"LIBDEF ISPPLIB DATASET ID('"PANELLIB"')"
ADDRESS ISPEXEC
"DISPLAY PANEL(TESTPAN)" /* TESTPAN & TESTPAN1 are the panels used in this program */

X=OPTION /* Option is the input value Keyed in the panel TESTPAN */
IF X=1 THEN DO
ADDRESS ISPEXEC
"DISPLAY PANEL(TESTPAN1)"
IF KEYPRESS=PF03 THEN DO
SAY 'Log off...'
EXIT
END
SAY 'Choosed ' OPTION1 /* OPTION1 is the value keyed by user in panel TESTPAN1 */
END

TRAP:
SAY 'ENTERED TRAP...Input Keyed is Unexpected'
EXIT



Once i press F3 after entering panel TESTPAN .. I am getting message like 'ENTERED TRAP... Input keyed is unexpected..' Instead of getting message ' Log Off'...

Re: ISPF Panel Error Handling override

PostPosted: Thu Feb 23, 2012 12:16 pm
by NicC
Well, for a start the PF3 key is processed by ISPF to terminate the panel. It is not, generally, something that is available to your program. Run your program with Rexx trace enabled and follow it through and you will see what is happening. Also, refer to the Rexx language reference and the ISPF Dialog Developers Guide.

Re: ISPF Panel Error Handling override

PostPosted: Thu Feb 23, 2012 1:45 pm
by enrico-sorichetti
F KEYPRESS=PF03 THEN DO

if instead of wasting time inventing Your own syntax You had spent it in reading the manuals

here for REXX
http://publibz.boulder.ibm.com/cgi-bin/ ... s/IKJ4BK90
here for ISPF
http://publibz.boulder.ibm.com/cgi-bin/ ... s/ISPZPM70
old but still more than enough for basic needs

or using the MODEL command for a skel of the various ISPF services invocations

the chances of getting the expected results would have been higher :geek:

specifically for the DISPLAY services the pages of interest start from
http://publibz.boulder.ibm.com/cgi-bin/ ... 0610213539

and a RETURN CODE 8 implies that the END ( PF3 ) has been entered by the user

Re: ISPF Panel Error Handling override

PostPosted: Fri Feb 24, 2012 2:19 am
by Pedro
I have a generic error traping module to be executed if any unexpected inputs are keyed.


I am somewhat dubious that it will get called based on user input. You issued SIGNAL ON ERROR, so it will get called for unexpected return codes, but it will not get called for the user typing a 2 instead of a 1. At least, it will not get called because of SIGNAL.

Once i press F3 after entering panel TESTPAN .. I am getting message like 'ENTERED TRAP... Input keyed is unexpected..' Instead of getting message ' Log Off'...


Your program only enters the logoff sequence after TESTPAN1. But it is skipped if the OPTION response to TESTPAN is not a 1. The bulk of the program is skipped and falls clumsily through to the TRAP routine. I think you need to exit before the TRAP routine.