Execution of a command file
A command file can be called from any physical console and from any authorized user program, provided it has authorization code “E” (see section "Authorized user programs with operator functions"). However, all the functional areas to which the commands in the command file refer must have been assigned to the calling console or user program (via the authorization code).
The system processes no more than one command file at a given time. If a further RUN command is received during processing of a command file, the system delays execution of this command until processing of the current command file has been completed.
The system behaves as follows:
if there are a number of RUN commands within a command sequence, they are processed in the order in which they appear in the command sequence.
if a RUN procedure is stopped by a CANCEL-RUN-PROCESS command, none of the RUN commands held in the RUN file will be executed after that.
When execution of a command file is started, message NBR1000
indicates this. The caller of a command file receives only messages that are generated on execution of the various commands; the commands themselves are normally not displayed to the caller. If the issuer of a command wishes to record the command from the RUN file on the console, this can be arranged by means of the system parameter NBRUNSP=Y. Irrespective of the system parameter NBRUNSP, commands from RUN files are recorded in the logging file (CONSLOG).
If a command file contains special commands, it will only execute correctly if the authorized user program that is to receive and execute the special commands has already been started.
Therefore the execution of any command file containing special commands must be coordinated with the start of the authorized user program. To this end, the following actions have to be initiated from the RUN procedure:
Start authorized user programs for handling of special commands (using ENTER-JOB commands)
Halt processing of command file and define continuation criterion (using the ASTOP command)
In order to take advantage of the startup interval required by the tasks it is advisable to place the ENTER-JOB commands at the beginning of the command file and the ASTOP command directly before the first special command.
Processing of the command file continues if one of the following conditions is satisfied:
as many AGOGO commands have arrived as are specified in the criterion of the ASTOP command or
the waiting time has elapsed and the required number of AGOGO commands have not arrived.
The time interval for which command processing is interrupted by an ASTOP command can be specified using the system parameter NBRUNWT. This can have a value from 10 to 255 seconds, and by default is 180 seconds.
Example for a special command
Systems support has provided the special command SPECI for the system which is its responsibility; this command is to be used in the command file following system startup.
This file must contain the following commands (among others):
/ENTER-JOB SPEC.CMD-PROC : /ASTOP /SPECI :
The SPEC.CMD-PROC file must contain a suitable command sequence for starting the user program which was created for processing the SPECI command. In addition, the file should contain the AGOGO command which, in conjunction with the ASTOP command of the RUN procedure, ensures the synchronization.
Some commands, such as SHOW-PENDING-MSG, are processed by the system with a higher priority than others. If such commands are specified in a command file, they can “overtake” other commands which are in front of them in the command file.
The interplay between command file processing and the actions of a single authorized user program is shown in the following diagram.
Figure 29: Processing a command file
Aborting a command file
The CANCEL-RUN-PROCESS command aborts processing of a command file that has been started. To execute this command, the operator must specify a run ID that is assigned to each command file after it is started by the RUN command. A command file that is started recursively from another RUN sequence has the same run ID as the command file that generated it. Aborting a command file with the CANCEL-RUN-PROCESS command automatically aborts all command files generated by this command file. This command does not necessarily have to be entered at the same console as the RUN command. However, it does require the authorization code E.