When working from ICL it is frequently useful to be able to access features of Digital’s command language DCL. Typical operations we may want to do include listing directories, copying files, allocating tape drives and mounting tapes.

5.1 The $Command The command$ allows any DCL command to be issued from inside ICL. It’s form is simply:

$dcl_command where dcl_command is any command we could issue from the DCL$ prompt. For example:

$COPY *.DST DATADIR:*.DST$ RUN MYPROGRAM

There is one restriction — we must use a complete DCL command. We couldn’t for example, just type $COPY and let DCL prompt us for the two file specifications as we could from the DCL$ prompt. Apart from this any command acceptable to DCL can be issued in this way.

‘DCL’ may be used as an alternative to the $command. Thus the above example could also have been written as: DCL COPY *.DST DATADIR:*.DST DCL RUN MYPROGRAM 5.2 The SPAWN Command There is also a way round the restriction mentioned above. This is to use the command SPAWN rather than the$ command. For example:

ICL> SPAWN COPY
_From: *.DST

in which case we get the From: and To: prompts just as we do in normal DCL. The disadvantage of SPAWN is that it is normally much slower. This is because SPAWN creates a new subprocess to issue each command, whereas DCL creates a permanent subprocess in which all commands are issued.

SPAWN has another use — by just typing SPAWN we can get a DCL $prompt from which a series of DCL commands can be executed. LOGOUT is then used to return control to ICL. 5.3 Changing the Default Directory It might seem that the above facilities provide all we need. Unfortunately things are not that simple. The problem is that VMS only provides the facility to issue a DCL command in a subprocess, not in the process we are actually running ICL in. Thus although we can issue any DCL command we cannot issue DCL commands in the process we are running ICL in. In many cases this does not matter, the command will have the same effect whatever process it is issued from. However, this is not always the case. One example is changing the default directory — this can be done using the ICL command$ SET DEFAULT. This will change the default directory of the DCL subprocess, but not of the process running ICL.

Thus an additional ICL command DEFAULT (which may be abbreviated to DEF) has been provided. This changes the default directory of both the process running ICL and the DCL subprocess (if one exists). The format for specifying the directory is exactly the same as that accepted by the DCL SET DEFAULT command.

5.4 Allocating and Mounting Tape Drives

Similar problems occur when allocating and mounting tape drives. \$ ALLOCATE will allocate the device to the DCL subprocess. This may be what you want, for example, if you are going to use another DCL command (such as BACKUP) to read or write the tape. However if the tape is to be processed using a FIGARO command it must be allocated to the process running ICL.

A set of commands has been provided for this purpose as follows:

 command abbreviation function ALLOC dev ALL allocate a device MOUNT dev MOU mount a device DISMOUNT dev DISMOU dismount a device DEALLOC dev DEALL deallocate a device
Mount performs a MOUNT/FOREIGN at the tapes initialized density. It does not provide the many qualifiers of the DCL command. There are several additional optional parameters for some of these commands. ALLOC may specify a generic name, and the name of the device actually allocated will be returned in the optional second parameter.

ICL> ALL MT
_MTA0: Allocated
ICL> ALL MT (DEVICE)
_MTA1: Allocated
ICL> =DEVICE
_MTA1:

DISMOUNT has an optional parameter which is used to specify that the tape be dismounted without unloading.