How To
Summary
ISPF makes it easy to use z/OS. You can use ISPF to create, modify, compile, and test programs, run utilities, and generally do your day-to-day tasks. But if you have repetitive, complex, or long-running tasks, it can make sense to run them in the background.
Objective
The setup for using ISPF in batch is much like the setup for using ISPF interactively. The setup that is normally done in your logon proc or your ISPF exec needs to be done in JCL. You need to allocate all of the ISPF product data sets and establish the ISPF environment. Your JCL needs to
- Run the IKJEFT01 utility.
- Use DD statements to allocate the ISPF product data sets.
- Use the ISPSTART command to establish the ISPF environment for the command.
Steps
Code your JCL
Run IKJEFT01
Your EXEC statement runs IKJEFT01 utility, which runs TSO's Terminal Monitoring Program (TMP).
Allocate ISPF DDNames
You need DD statements to allocate the appropriate data sets.
- An ISPF profile
- ISPPROF, which you can specify either as a
- Temporary data set, or
- An existing data set, specified with DISP=OLD to ensure exclusive use of a cataloged profile data set. If you use an existing data set with DISP=SHR, the job often fails with ABEND 998, like this:
IEF142I SHELLYA ISPFSTP - STEP WAS EXECUTED - COND CODE 0998
ISPT036 Table in use -/-TBOPEN issued for table ISPSPROF that is in use, ENQUEUE failed.
- ISPPROF, which you can specify either as a
- All required ISPF product ddnames
- SYSPROC - REXX execs or CLISTs
- ISPPLIB - panels
- ISPMLIB - messages
- ISPSLIB - skeletons
- ISPTLIB - tables
- Specify a temporary data set as the first data set in DDname ISPTLIB. If the ISPPROF data set is new or temporary, ISPF needs to access ISPTLIB to get defaults for the profile. If two jobs run concurrently and the first data set in ISPTLIB is ISP.SISPTABL, one of the jobs fails with error message:
ISPT036 Table in use TBOPEN issued for table ISPSPROF that is in use, ENQUEUE failed.
- Any data sets your application needs
- ISPLLIB for any load modules
- SYSPROC or SYSEXEC for any CLISTs or REXX execs.
- ISPTABL for any output tables
- ISPLOG to show any logged messages
Invoke ISPSTART
The SYSTSIN DD statement starts the application with the ISPSTART command.
Code your Application for Batch
There are a few situations that require particular attention in batch.
-
Display
Since there is no user interaction in batch, if the dialog uses any of the display services (DISPLAY, TBDISPL, SELECT PANEL, SETMSG, PQUERY), the dialog must provide input that would normally be supplied by the user. You might need to either:
- Change the DISPLAY service to use the COMMAND parameter, like this:
stkbuf = 'END' 'DISPLAY PANEL('panname') COMMAND(stkbuf)'
- Or alter panels to simulate an END or ENTER key by using the .RESP keyword in your panel definition, for example.
)INIT
.RESP = ENTER
If there is an error in the display processing, an infinite loop can occur. To prevent an infinite loop, use the BDISPMAX parameter on the ISPSTART command so the dialog ends after the specified number of displays. Use the BREDIMAX parameter so that the dialog ends after the specified number of redisplays. The screen width and screen depth can also be set for batch:
ISPSTART CMD(SERVPAN) BATSCRW(132) BATSCRD(50) BDISPMAX(255) BREDIMAX(2)
This ISPSTART command runs a REXX exec called SERVPAN, which "displays" any panels with a screen width of 132, and a screen depth of 50. The job "displays" 255 panels, and on the 256th display, the job ends with code 990, and a message is written to the job output:
ISPP330 BDISPMAX exceeded -/-255 displays exceeded in batch mode on panel SERVPAN
If the job "redisplays" a panel twice, on the third redisplay, the job terminates with message:
ISPP331 BREDIMAX exceeded -/-2 ;msg redisplays exceeded in batch mode.
The default value for BDISPMAX is 100 and the default value for BREDIMAX is 2.
-
Edit
To run EDIT in batch, you must use an initial edit macro to provide the input that would normally be supplied by the user. This initial macro can do anything that can be done by an initial macro in an interactive session. However, in batch, the macro must end with an ISREDIT END or ISREDIT CANCEL statement. These statements ensure that no attempt is made to display the edit screen in batch. Without these statements, an infinite loop can result.
-
Abend 998
If your batch ISPF job gets a 998 abend, often a message appears to describe the error. If not, here are some things to consider:
- Are all required data element libraries allocated?
- Can all ISPF data element libraries be opened? Try browsing each of the data sets to make sure there are no errors.
- Do the data element libraries have valid data set characteristics? Use the Library Utility (option 3.2) or the Data Set List Utility (option 3.4) to display data set information. For more information about the required characteristics, see the ISPF User's Guide Volume 1.
- Can the literals module be loaded? The literals modules are ISRNLxxx and ISPNLxxx, where xxx is the suffix based on the language. You can see where they are loaded in your ISPF session, by using the DDLIST command. Type DDLIST on any ISPF command line. Then, type LOAD ISRNLENU, for example, to see where the English language literals module is loaded. Compare the results to your JCL.
- Is ISPF being called recursively? If so, modify your code so that ISPF is not called recursively.
Sample JCL
The attached JCL shows
- EXEC PGM=IKJEFT01 to start TSO TMP
- Allocation of all ISPF ddnames, including
- ISPPROF as a temporary data set
- ISPLLIB to hold the application load module
- ISPTLIB with a temporary data set as the first data set in the concatenation
- ISPLOG to show the ISPF messages log
- SYSEXEC and SYSPROC to hold the REXX execs and CLISTs
- ISPSTART command, which sets up the ISPF environment and invokes a REXX exec called ISPFCMD.
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
27 September 2023
UID
ibm11143304