Page 1 of 1

Issue with REXX and ISPF panels

PostPosted: Mon Feb 11, 2013 4:30 am
by vlad
Hello Mainframers,

I would like to ask you one question:

I’m trying to make one simple program using REXX and ISPF panels. This program is running fine except one think, when I’m in the first panel and select option 1 and press ENTER, it’s nothing happened. In the second time when I select option 1 and press ENTER the program redirect to the second panel.

Could you please advise me what to change in my program to reduce the double pressing ENTER to jump from panel 1 to panel 2.

Here is the code:

REXX program:
/* REXX */                                       
"ISPEXEC DISPLAY PANEL(TEST2)"             
PULL A                                       
IF A=1 THEN "ISPEXEC DISPLAY PANEL(TEST1)"   
ELSE                                         
SAY A                                         
EXIT


Panel1:
)ATTR DEFAULT(%+_)                                                 
@ TYPE(INPUT) INTENS(HIGH) CAPS(ON) JUST(LEFT )                     
` TYPE(TEXT) INTENS(HIGH) CAPS(OFF) JUST(ASIS ) COLOR(YELLOW)       
~ TYPE(TEXT) INTENS(HIGH) CAPS(OFF) JUST(ASIS ) COLOR(TURQ)         
% TYPE(TEXT) INTENS(HIGH)                                           
# TYPE(TEXT) INTENS(HIGH) COLOR(TURQ) HILITE(REVERSE)               
)BODY WINDOW(62,32)                                                 
                        #MDS POWER PROG!!!!!!                       
%COMMAND ===>@A                                                     
 ~PLEASE SELECT AN OPTION:                                         
~                                                                   
`1+ LIST DATASET ATTRIBUTES                                         
`2+ COMPRESS A PDS DATASET                                         
`3+ EDIT PDS DATASET ATTRIBUTES                                     
`4+ CREATE NEW PDS                                                 
`5+ COPY PDS AND ALL DIR. BLOCKS                                   
`6+ DELETE DATASET ON DASD AND TAPE                                 
`7+ GENERATION DATA GROUPS (GDG)                                   
`8+ GENERATION ALIAS                                               
`9+ EXIT                                                           
~                                                                   
ENTER                                                               
)INIT                                                               
)END                                                               


Panel2:
)ATTR                     
)BODY WINDOW(70,20)       
# test ==>           
! test ==>         
)END


Code'd

Re: Issue with REXX and ISPF panels

PostPosted: Mon Feb 11, 2013 5:45 am
by MrSpock
Get rid of the statement "PULL A" and then post a copy of the execution of your REXX exec with a trace on.

Re: Issue with REXX and ISPF panels

PostPosted: Mon Feb 11, 2013 6:04 am
by enrico-sorichetti
it looks like You are trying to reinvent the wheel ...
any reason to duplicate functions already provided by vanilla ISPF ???

Re: Issue with REXX and ISPF panels

PostPosted: Mon Feb 11, 2013 7:48 am
by vlad
Hello All,
I'm just a student in a Technical University. I'm curios about the IBM Mainframe technologies. I would like to develop myself as a Mainframe programer. I'm trying to make one simple example of REXX program with ISPF panels.

Now about ny question:
I removed the PULL function from the REXX program. Now my simple program is working fine.
About the execution of the REXX program with trace on, I'm searching how to do it.

Thank you very much MrSpock for you advice!
Thanks to All good luck!

Re: Issue with REXX and ISPF panels

PostPosted: Mon Feb 11, 2013 10:15 pm
by Pedro
The problem was not explained well...
1. the DISPLAY PANEL statement asks the user for input, using a full screen method.
2. the PULL statement asks the user for input, using a line mode method.

Since you ask the user for two times, the user is required to press Enter two times.

Re: Issue with REXX and ISPF panels

PostPosted: Wed Mar 27, 2013 12:14 am
by chgman7
There are multiple way to resolve this issue, but I would add a VPUT to the panel, to put "A" into the profile pool. Then in the REXX EXEC, a VGET can be used to retrieve "A" from the profile pool. Also, I favor variable names that describe the variable.

Re: Issue with REXX and ISPF panels

PostPosted: Wed Mar 27, 2013 12:45 am
by enrico-sorichetti
panel1 should not be <displayed> using DISPLAY
since it is a <selection> panel a SELECT should be used
and each option should point to the appropriate REXX script

in this way ALL the PANEL navigation will be handled by ISPF itself