Sometimes I run into problems with ISPF and search for help on the internet. During such a search I noticed that it is possible to code REXX directly into an ISPF panel. This is actually quite nice as the code available in ISPF panels can be rather clumsy. I have not tried this stuff myself as I have not yet been in need for it.
This tip is based solely on different sources found on the internet and the ISPF manuals. Please visit ISPF Dialog Developer's Guide and Reference for further information. The link is for z/OS 1.9, but *REXX was already introduced in z/OS 1.6.
Here is an example:
The specification (*) after *REXX means that your REXX code will have access to all the variables used by the )BODY section and is able to update them as well. According to Peter Van Dyke from the ISPF lab there are a few details you must be aware of. The first is that z/OS 1.8 and earlier cannot extent the size of a variable. Another detail is that variables not defined in the )BODY section must be explitcitly stated in the *REXX() specification. Assume your inline REXX code needs to have access to variable NOINBDY which is not used in )BODY, then you should specify *REXX(*,NOTINBDY). You can specify more variables by putting them into the parenthesis separated by commas.