todd@stiatl.UUCP (Todd Merriman) (12/15/88)
$! BATCH.COM $ SET NOVERIFY $ SET NOON $ QUENAME="SYS$BATCH" $ IF P1 .NES. "" THEN QUENAME="''P1'" $ ON CONTROL_Y THEN GOTO ABORTED $ OPEN/WRITE OFILE SYS$LOGIN:ZZZ.COM ! open the command file $ WRITE OFILE "$ SET NOON" $ WRITE OFILE "$ SET DEFAULT ",F$ENVIRONMENT("DEFAULT") ! set current $ WRITE SYS$OUTPUT - ! prompt for entry "BATCH - enter your commands" $ TOP: ! top of input loop $ READ/PROMPT=""/END_OF_FILE=DONE SYS$COMMAND BUFFER $ IF F$LENGTH(BUFFER) .GT. 0 THEN - WRITE OFILE "$ ",BUFFER $ IF F$LENGTH(BUFFER) .GT. 0 THEN GOTO TOP ! not an empty line $ DONE: $ WRITE OFILE "$ EXIT $STATUS" $ CLOSE OFILE ! close command file $ WRITE SYS$OUTPUT "Submitting..." $ SUBMIT/NOPRINT/NAME=BATCH/LOG=BATCH/NOTIFY/QUEUE='QUENAME' - SYS$LOGIN:ZZZ.COM/DELETE $ WRITE SYS$OUTPUT "log = SYS$LOGIN:BATCH.LOG" $ EXIT $ ABORTED: ! close file on control_y $ CLOSE OFILE $ DELETE/LOG SYS$LOGIN:ZZZ.COM; $ WRITE SYS$OUTPUT "** ABORTED **" $ EXIT ***************************************************************************** .MODULE batch .LIBRARY util .TYPE command file .SYSTEM vms .AUTHOR Todd Merriman with help from Edward A. Lyon .LANGUAGE dcl .APPLICATION system .DESCRIPTION Batch commands for the batch processor .ARGUMENTS BATCH [queue] .NARRATIVE The BATCH command file allows multiple command lines to be batched together and SUBMITed to the batch processor. Any number of commands may be typed in, each followed by a [RETURN]. An empty line initiates the SUBMIT. Input line editing is available. .RETURNS nothing .ENDOC END DOCUMENTATION *****************************************************************************