| semigeezer Supermod
 
 
 Joined: 03 Jan 2003
 Posts: 1014
 Topics: 13
 Location: Atlantis
 
 | 
			
				|  Posted: Thu Nov 24, 2005 1:08 am    Post subject: Can I run TSO in batch?  What about ISPF? |   |  
				| 
 |  
				| Since TSO is just a command line environment, it is easy to understand what running TSO in batch means; you can run TSO commands, including CLISTs and Rexx execs in batch.  TSO in batch is just the invocation of IKJEFT01 or one of its variants. 
 ISPF, on the other hand, is usually a 3270 full screen interactive program with panels and messages.  So what does it mean for ISPF to run in batch?  Well there is no terminal.  So ISPF formats panels, but never displays them.  Instead, in batch, ISPF always simulates an ENTER key after logically displaying the panel.  That means that if you run an ISPF program in batch, it must be able to complete using only ENTER keys as input.  There is no way to fill in panel fields, no way to navigate around in an application and no way to press PF keys or enter commands on screens.
 
 You run ISPF in batch to run your programs that use ISPF services in batch. You do not run ISPF in batch to simulate using screens.  You can't use batch to automate typing at the terminal.
 
 Usually people run edit macros in batch.  That means the macro must exit with an END or CANCEL command.
 
 If you get an error referring to BDISPMAX, it means that your program got into a loop where pressing the ENTER key was not enough to end the program.  BDISPMAX errors usually mean that an ISPF error panel (sometimes called a "flower box") was displayed.  When the virtual enter key was pressed, the message screen was displayed again.  And so on.
 
 To run ISPF in batch you must allocate the ISPF data sets to the appropriate ddnames.  You can find these ddnames using the TSO ISRDDN command.  Unless you are using variables from your TSO session (very rare and not trivial to do), you do not need to allocate your ISPF profile library to the job.  Use a temporary data set.  If  you must use your profile library, copy it to a temporary data set in a previous job step.
 
 You can automatically create a JCL sample that will run in your environment using a Rexx exec called BATCHPDF which was written by an end user (me) and is not supported by IBM or anyone else.
 JCL for ISPF in batch will look something like this:
  	  | Code: |  	  | //GENER0   EXEC PGM=IEBGENER              Create temp clist and profile //SYSUT1   DD *
 SET ZISPFRC = 0
 ISPEXEC VPUT (ZISPFRC) SHARED     /* set step return code */
 //SYSUT2   DD DISP=(NEW,PASS),DSN=&&CLIST0(TEMPNAME),
 //            SPACE=(TRK,(1,1,2),RLSE),UNIT=SYSALLDA,
 //            DCB=(LRECL=80,BLKSIZE=0,DSORG=PO,RECFM=FB)
 //PROFILE  DD DISP=(NEW,CATLG),DSN=USER1.T120481.ISPPROF,
 //            SPACE=(TRK,(10,10,5)),UNIT=SYSALLDA,
 //            DCB=(LRECL=80,BLKSIZE=0,DSORG=PO,RECFM=FB)
 //SYSPRINT DD DUMMY
 //SYSIN    DD DUMMY
 //BATCHPDF EXEC PGM=IKJEFT01,DYNAMNBR=128  Invoke TSO
 //ISPPLIB  DD DISP=SHR,DSN=ISP.SISPPENU
 //ISPSLIB  DD DISP=SHR,DSN=ISP.SISPSLIB
 //         DD DISP=SHR,DSN=ISP.SISPSENU
 //ISPMLIB  DD DISP=SHR,DSN=ISP.SISPMENU
 //ISPPROF  DD DISP=(OLD,PASS),DSN=USER1.T120481.ISPPROF
 //ISPTABL  DD DISP=(OLD,PASS),DSN=USER1.T120481.ISPPROF
 //ISPTLIB  DD DISP=(OLD,PASS),DSN=USER1.T120481.ISPPROF
 //         DD DISP=SHR,DSN=ISP.SISPTENU
 //ISPCTL0  DD DISP=(NEW,DELETE),SPACE=(TRK,(10,10)),UNIT=VIO,
 //            DCB=(LRECL=80,BLKSIZE=0,DSORG=PS,RECFM=FB)
 //ISPCTL1  DD DISP=(NEW,DELETE),SPACE=(TRK,(10,10)),UNIT=VIO,
 //            DCB=(LRECL=80,BLKSIZE=0,DSORG=PS,RECFM=FB)
 //ISPWRK1  DD DISP=(NEW,DELETE),SPACE=(TRK,(10,10)),UNIT=VIO,
 //            DCB=(LRECL=80,BLKSIZE=0,DSORG=PS,RECFM=FB)
 //ISPLST1  DD DISP=(NEW,DELETE),SPACE=(TRK,(10,10)),
 //            DCB=(LRECL=133,BLKSIZE=0,DSORG=PS,RECFM=VB)
 //ISPLOG   DD SYSOUT=*,
 //            DCB=(LRECL=120,BLKSIZE=2400,DSORG=PS,RECFM=FB)
 //ISPLIST  DD SYSOUT=*,DCB=(LRECL=121,BLKSIZE=1210,RECFM=FBA)
 //SYSTSPRT DD SYSOUT=*
 //SYSTSIN  DD *
 PROFILE PREFIX(USER1)
 ISPSTART CMD(%TEMPNAME) NEWAPPL(ISR)
 //SYSEXEC  DD DISP=SHR,DSN=ISP.SISPEXEC
 //SYSPROC  DD DSN=&&CLIST0,DISP=(OLD,DELETE)
 //         DD DISP=SHR,DSN=ISP.SISPCLIB
 //DELPROF  EXEC PGM=IEFBR14        Delete temporary profile data set
 //DELETEDD DD DSN=USER1.T120481.ISPPROF,DISP=(OLD,DELETE)
 
 | 
 |  |