BSP - Beratung, Schulung, Projekte


BSPRUNSC - Run a script of OS Commands from Batch or STC

What does it do?

This program will read input data from a member of a PDS with DDNAME SCRIPTS. If no SCRIPTS DDNAME is found, SYS1.PARMLIB will be used

The member to be used is specified via the PARM passed to the program. If none if specified, a default of BSPRUNSC is used

JCL Execution Parameters are specified via the PARM statement on the EXEC card:

PARM=xxxxxxxx Run the script xxxxxxxx

Required DD names

none

Optional DD names

DDNAME Description Default
SCRIPTS points to PDS with OS command scripts SYS1.PARMLIB
SYSPRINT output queue for report SYSOUT=X
SYSUDUMP never used SYSOUT=X

Layout of script members

An asteriks (*) in col 1 means a comment, this line gets ignored.

Leading spaces will be removed from the script line

PARM TESTdon't exec, just simulate (default)
PARM CHECKsame as PARM TEST
PARM ECHOshow commands on console (default)
PARM NOECHOno longer echo commands to console
PARM EXECExecute the script, ask operator first
PARM NOREPLYUExecute the script, don't ask operator permission
PARM REPLYUNext time, ask operator permission again
CONTINUEDoes nothing
WAIT xxxWait specified number of seconds before going on. Default is 10 seconds
COM cccExecute the command ccc
CMD cccExecute the command ccc, equivalent to COM
MSG tttshow the message with the text ttttt
WTO tttequivalent to MSG
IF xxxxxxxxexecute following command if xxxxxxxx is active
ELSEotherwise execute the second branch
ENDIFend of IF construct. IF may not be nested (yet)

Sample members are provided in SYS1.PARMLIB(SCRIPT01) and SYS1.PARMLIB(SCRIPT02)

Usage

Assembly and Link JCL can be found in SYS1.SETUP.CNTL(RUNSC$).
Execution JCL can be found in SYS1.SETUP.CNTL(RUNSC#)

Sample SCRIPT00 Member

***********************************************************************
*                                                                     *
* Name: SYS1.PARMLIB(SCRIPT00)                                        *
*                                                                     *
* Desc: Sample Script member                                          *
*                                                                     *
***********************************************************************
PARM ECHO
PARM REPLYU
IF MF1
   CONTINUE
ELSE
   COM S MF1
ENDIF
PARM NOECHO
WAIT 5
IF MF1
   CONTINUE
ELSE
   MSG MF/1 could not be started, check system log for errors
ENDIF

Disclaimer

Although this program has been tested on the Turnkey MVS system Version 3 it is not guaranteed to be bug-free (which program is?)

Use at your own risk