ISPF Panel Error Handling override



IBM's Command List programming language & Restructured Extended Executor

ISPF Panel Error Handling override

Postby Balamurugan21 » Thu Feb 23, 2012 12:04 pm

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'...
Balamurugan21
 
Posts: 6
Joined: Tue Feb 14, 2012 2:29 pm
Has thanked: 2 times
Been thanked: 0 time

Re: ISPF Panel Error Handling override

Postby NicC » Thu Feb 23, 2012 12:16 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: ISPF Panel Error Handling override

Postby enrico-sorichetti » Thu Feb 23, 2012 1:45 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: ISPF Panel Error Handling override

Postby Pedro » Fri Feb 24, 2012 2:19 am

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.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post