Search code examples
panelcobolmainframeispf

How to call, send and receive info from/to a panel(ISPF) in COBOL


I have an ISPF panel named MYPANEL created with 2 variables: One for input named INV (filled by the user) and one for output named OTV (filled by the program). What I need is a sample with a COBOL program, on how to call the panel, how to receive the variable INV and how to send the variable OTV with the value of INV + ' the output'.


Solution

  • Many years ago ISPF used to have an examples manual. Here is a link to a COBOL example from the ISPF 4.2 manual (around 1995 or so).

    https://www.ibm.com/support/libraryserver_os390/handheld/BOOKS/ISPEXM01/1.2.10.2?SHELF=ez239700&DT=19950613095341&CASE=

    One thing to remember in using VDEFINE in COBOL (or any language) is that this defines storage to ISPF. ISPF expects that storage to stay around until the VDELETE is done or the function pool created by the SELECT service goes away. So be careful in calling a routine to do VDEFINES and then returning to a program. The called routines storage that was VDEFINE'd must still be owned by the main COBOL program or you can get 0C4's.