1 BAT BAT will submit a series of commands to a batch queue, eliminating the need for the user to manually create a command procedure to perform the tasks. Commands to be executed in batch may be specified on the command line; multiple commands can be separated by "|". If commands are not given on the command line, BAT will prompt for commands until a null line or CTRL-Z is entered. The temporary command procedure that is created contains commands to set VERIFY and to change the default directory for the batch job to the current default directory of the process running BAT. Format: $ BAT [/qualifiers] [command [|command...]] 2 Parameters [/qualifiers] All BAT qualifiers must immediately follow the BAT verb to be recognized as BAT qualifiers. [command [|command...]] A command or list of commands that are to be executed in batch. Multiple commands separated by "|" (vertical bar) may be specified. 2 Qualifiers /AFTER /AFTER=time /NOAFTER Requests that the job be held until after a specific time. If the specified time has passed already, the job is processed immediately. You can specify time as either an absolute time or as a combination of absolute and delta times. For complete information on specifying time values, see the VMS DCL Concepts Manual. /CPUTIME /CPUTIME=time Defines a CPU time limit for the batch job. You can specify time as delta time, 0, INFINITE, or NONE. If the queue on which the job executes has a defined CPUMAXIMUM value, the smaller of the SUBMIT command and queue values is used. If the queue on which the job executes does not have a specified maximum CPU time limit, the smaller of the SUBMIT command and user authorization file UAF) values is used. If the queue on which the job executes does not have a specified maximum CPU time limit and the UAF has a specified CPU time limit of NONE, either the value 0 or the keyword INFINITE allows unlimited CPU time. If you specify the keyword NONE, the specified queue or UAF value is used. CPU time values must be greater than or equal to the number specified by the SYSGEN parameter PQL_MCPULM. Unlike many DCL commands, if days are specified, the delta time must be enclosed in quotes. /HOLD /HOLD /NOHOLD (default) Controls whether the job is made available for immediate processing. The /HOLD qualifier holds the job until it is released by the SET ENTRY/RELEASE or the SET ENTRY/NOHOLD command. /LOG_FILE /LOG_FILE[=filespec] (default) /NOLOG_FILE Names the log file. No wildcards (* and %) are allowed in the file specification. When you use the /LOG_FILE qualifier, the system writes the batch job's output to the file you specify. If you use the /NOLOG_FILE qualifier, no log file is created. By default, a log file is created, using SYS$LOGIN:name.LOG as the default file name, where "name" is the name of the batch job. /KEEP /KEEP /NOKEEP (default) Controls whether or not the temporary command file is deleted. Note: BAT does not use /KEEP in the same that SUBMIT uses /KEEP. /NAME /NAME=job-name Names the job, the temporary command procedure, and the batch log file (unless /NOLOG is given). The job name must specify a valid file name of up to 39 characters. The default job name is BATCHTMP_xxxxxxxx, where "xxxxxxxx" is the PID of the current process. /NOTIFY /NOTIFY (default) /NONOTIFY Controls whether a message is broadcast to your terminal session when the job is completed or aborted. /PREFIX /PREFIX="Prefix" (defaults to /PREFIX="(!8%T) ") /NOPREFIX Specifies the argument to the DCL command SET PREFIX, which is included at the beginning of the BAT temporary command procedure. The prefix string should be surrounded by quotes and can contain some FAO directives, including "!%T" and "!%D". For more information, consult the on-line help for SET PREFIX. Because the SET PREFIX command was introduced with VMS v5.5, this qualifier should only be specified on VMS v5.5 and higher. On other versions of VMS, a non-fatal error will occur for each batch job. /PRINTER /PRINTER=[queue-name] /NOPRINTER (default) Queues the job log file for printing when your job is completed. The /PRINTER qualifier allows you to specify a particular print queue; the default print queue is SYS$PRINT. /PRIORITY /PRIORITY=n Requires OPER (operator) or ALTPRI (alter privilege) privilege to specify a priority greater than the value of the SYSGEN parameter MAXQUEPRI. Specifies the job-scheduling priority for the batch job with respect to other jobs in the same queue. The value of n is an integer in the range of 0 to 255, where 0 is the lowest priority and 255 is the highest. The default value is the value of the SYSGEN parameter DEFQUEPRI. No privilege is needed to set the priority lower than the MAXQUEPRI value. The /PRIORITY qualifier has no effect on the job's process execution priority. The job's process execution priority is determined by the base priority attribute of the INITIALIZE/QUEUE /BASE_PRIORITY command. /QUEUE /QUEUE=queue-name[:] Identifies the batch queue on which the job is entered. The default queue is SYS$BATCH. /RESTART /RESTART /NORESTART (default) Indicates whether the job restarts after a system failure or after a STOP/QUEUE/REQUEUE command. /USER /USER=username Requires CMKRNL (change mode to kernel) privilege and read (R) and write (W) access to the user authorization file (UAF). Allows you to submit a job on behalf of another user. The job runs exactly as if that user had submitted it. The job runs under that user's user name and user identification code (UIC), and accounting information is logged to that user's account. By default, the user identification comes from the requesting process. The username qualifier value can be any user name that is validated on your system. The name must be 1 to 12 alphanumeric characters. /WSDEFAULT /WSDEFAULT=n Defines for a batch job a working set default, the default number of physical pages that the job can use. If the queue on which the job executes has a nonzero default working set, the smaller of the specified job and queue values is used. If the queue on which the job executes has a working set default of 0, the smaller of the specified job and UAF values (value established in the user authorization file) is used. If you specify the value 0 or NONE, the specified queue or UAF value is used. Working set default values must range between the numbers specified by the SYSGEN parameters PQL_MWSDEFAULT and WSMAX. /WSEXTENT /WSEXTENT=n Defines for the batch job a working set extent, the maximum amount of physical memory that the job can use. The job uses the maximum amount of physical memory only when the system has excess free pages. If the queue on which the job executes has a nonzero working set extent, the smaller of the specified job and queue values is used. If the queue on which the job executes has a working set extent of 0, the smaller of the specified job and the value established in the user authorization file (UAF) is used. If you specify the value 0 or NONE, the specified queue or UAF value is used. Working set extent values must range between the numbers specified by the SYSGEN parameters PQL_MWSEXTENT and WSMAX. /WSQUOTA /WSQUOTA=n Defines for the batch job a working set quota, the amount of physical memory that the job is guaranteed. If the queue on which the job executes has a nonzero working set quota, the smaller of the specified job and queue values is used. If the queue on which the job executes has a working set quota of 0, the smaller of the specified job or the value established in the user authorization file (UAF) is used. If you specify the value 0 or NONE, the specified queue or UAF value is used. Working set quota values must range between the numbers specified by the SYSGEN parameters PQL_MWSQUOTA and WSMAX. 2 Reading_From_SYS$INPUT In a batch job, SYS$INPUT is defined as the command procedure itself. BAT treats all input lines as implicit DCL commands; in order to specify data to be read by a program, the DECK and EOD (end of deck) keywords should be used. See subtopic Examples for an example of the use of DECK and EOD. 2 Examples 1. $ BAT SHOW USER|SHOW SYSTEM|SHOW TIME Job BATCHTMP ... started on ... In this example, 3 commands have been entered on the command line. The three commands will all be executed by a single batch job. 2. $ BAT _Command: SHOW USER _Command: SHOW SYSTEM _Command: SHOW TIME|SHOW QUOTA _Command: Job BATCHTMP ... started on ... $ In this example, no commands were given on the command line, so BAT prompts for individual commands. 3. $ BAT _Command: MAIL _Command: DECK _Deck: PURGE/RECLAIM _Deck: COMPRESS _Deck: EOD _Command: Job BATCHTMP ... started on ... $ In this example, the DECK and EOD keywords are used to allow program input from SYS$INPUT.