From:	CSBVAX::CSBVAX::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX"  7-DEC-1988 05:19
To:	MRGATE::"ARISIA::EVERHART"
Subj:	BATCH.COM batches commands for SUBMIT


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Mon,  5 DEC 88 22:02:16 PDT
Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Mon, 5 Dec 88 21:47:11 PST
Received: by ucbvax.Berkeley.EDU (5.61/1.31)
	id AA05912; Mon, 5 Dec 88 21:00:36 PST
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 5 Dec 88 21:55:44 GMT
From: emcard!stiatl!todd@gatech.edu  (Todd Merriman)
Organization: Sales Technologies Inc., Atlanta, GA
Subject: BATCH.COM batches commands for SUBMIT
Message-Id: <1989@stiatl.UUCP>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

$!  BATCH.COM
$  SET NOVERIFY
$  SET NOON
$  ON CONTROL_Y THEN GOTO ABORTED
$  BUFFER = ""					! input buffer
$  OPEN/WRITE OFILE SYS$LOGIN:ZZZ.COM		! open the command file
$!  need to get the full name of the file just opened
$  CALL REDIRECT -
   "DIRECTORY/COL=1/NOHEAD/NOTRAIL/VER=1 SYS$LOGIN:ZZZ.COM" -
   SYS$LOGIN:ZZZ.DAT
$  OPEN/READ DATFILE SYS$LOGIN:ZZZ.DAT
$  READ DATFILE FILENAME
$  CLOSE DATFILE
$  DELETE SYS$LOGIN:ZZZ.DAT;
$  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="" 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
$!  let the command file delete itself
$  WRITE OFILE -
   "$  DELETE ",FILENAME
$  WRITE OFILE "$  EXIT $STATUS"
$  CLOSE OFILE					! close command file
$  WRITE SYS$OUTPUT "Submitting..."
$  SUBMIT/NOPRINT/NAME=BATCH/LOG=BATCH/NOTIFY SYS$LOGIN:ZZZ.COM
$  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
$ REDIRECT: SUBROUTINE
$  DEFINE SYS$OUTPUT 'P2'
$  'P1'
$  DEASSIGN SYS$OUTPUT
$  EXIT
$ ENDSUBROUTINE
 *****************************************************************************
   Batch commands for the batch processor
   BATCH 
   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 is performed using INQUIRE, hence line editing is available.
   nothing  

   Some inevitable overhead is involved in getting the rev. no. of the 
   file to be deleted.
 *****************************************************************************

