May 2, 1988 CMD.IND, CSICMD.IND Control Files to do Operations which KMON won't Permit R. W. Barnard BIO/Comp Applications P. O. Box 18007 Albuquerque, NM 87185 There is no KMON command COPY/ALPHABETICAL xx yy. Nor can you issue the command TRANSF *.xx yy. By use of an IND control file to do the drudgery for you, it is possible to do these operations in the form of a command file. CMD.IND will create (and execute, if desired) a file of com- mands whose order may be specified by any switch on the DIRECTORY command. CSICMD.IND does the same thing, but puts the filespecs into CSI format. The arguments of CMD.IND are as follows: IND CMD[/Q] COMMAND[/Directory_Switches] FILESPEC1[/File_Switches] _ FILESPEC2 EXECUTE DELETE Examples of COMMANDs are COPY/ALPHA, DUMP/SINCE:3:DEC, etc. The switches applied to the COMMAND argument are used on the DIRECTORY command. Examples of FILESPEC1s are *.FOR, DU1:*.MAC, etc. Any File switches applied to this argument are applied to each file found by the DIRECTORY command. Examples of FILESPEC2s are the same as for FILESPEC1. If switches are used, they are simply considered as part of the FILESPEC2 string. Some commands do not require a FILESPEC2. You may use a ~ symbol in this case. If the EXECUTE switch has the value "EXE", the command file which is generated will be executed immediately. If the DELETE argument has the value "DEL", the command file will be deleted after it is executed. If you type IND CMD/Q, then a SET TT QUIET will be included at the beginning and SET TT NOQUIET at the end of the resultant command file. The logical name WF: must be assigned to some device, such as VM:. The command file built by CMD is placed on WF:. The file PARSE.IND is used by CMD.IND and CSICMD.IND and must be located on SY:. CMDIND.DOC - Page 2 The file has an interactive mode; if you do not enter any parame ters you will be prompted for them. One of the best ways to use CMD is to define UCL symbols, such as COPYA == r IND\SY:CMD/Q COPY/ALP ^1 ^2 EXE DEL This will copy in alphabetical order files specified by parameter 1 to parameter 2 and delete the command file at the conclusion of the operation. (Note: the UCL examples here assume the use of UCL+, which is available as DECUS Library #11-746). Another example is DUMPA == r IND\SY:CMD/Q DUMP/ALP ^1 ~ EXE DEL which will dump files specified by parameter 1 in alphabetical order. If you want the files dumped to the terminal, include the /TERM switch on the filespec parameter. (DUMPA du:*.for/TERM). CMDIND.DOC - Page 3 CSICMD.IND If you prefer to specify the files for your KMON command or pro gram using CSI format (OUTPUT=INPUT), then use the file CSICMD.IND. CSICMD has been written with TRANSF in mind, so it includes features to make "wild-card" file transfers easier. CSICMD has the following parameter list: IND CSICMD PROGRAM[/Directory_Switches] _ INPUT_FILESPEC[/File-Switches] OUTPUT_FILESPEC[/Switch] [EXECUTE] [DELETE] The INPUT_FILESPEC and OUTPUT_FILESPEC have the same meaning as FILESPEC1 and FILESPEC2, respectively, in CMD.IND above. Directory_Switches and File_Switches are the same as described for CMD.IND above. If the EXECUTE switch has the value "EXE", the command file which is generated will be executed immediately. If the DELETE argument has the value "DEL", the command file will be deleted after it is executed. Note that you may specify the DELETE switch without setting the EXECUTE switch. Thus, you may create a command file on one system, ship it to a system to which you are linked by VTCOM/TRANSF and execute it where it will delete itself at the conclusion. The file has an interactive mode; if you do not enter any parame ters you will be prompted for them. CSICMD produces a file of the form r PROGRAM OUTPUT1/Switch=INPUT1/File_Switch OUTPUT2/Switch=INPUT2/File_Switch ... ^C When using CSICMD with VTCOM/TRANSF, there is a problem that your files may be on the "wrong" system. For example, to transfer files from a remote system to a host, you must run CSICMD on the remote and then copy the resultant command file from the remote to the host before you can transfer the files you want. Conversely, to transfer files from the host to the remote, you must first have CSICMD and PARSE on the host. The following examples will clarify this: REMOTE -> HOST (While on remote - not connected to Host) .IND CSICMD TRANSF/SINCE:14 WRK:*.FOR/T VD3: NOEXE DEL This will prepare a command file on your remote system called WF:TRANSF.COM which will specify files which have been created since the 14th, with the extension .FOR, and which are located on the device with the name WRK. The command file TRANSF.COM in- cludes a command to delete itself when it finishes. The file will CMDIND.DOC - Page 4 look as follows: r TRANSF VD3:File1.FOR=DDn:File1.FOR/T VD3:File2.FOR=DDn:File2.FOR/T ... VD3:FileN.FOR=DDn:FileN.FOR/T ^C DELETE/NOQ WF:TRANSF.COM where DDn: is the physical device specified by WRK:. Note that the device name VD3: was not translated; you do not need to have the same devices on both the host and remote to allow CSICMD to work. After TRANSF.COM is prepared, log onto the host. (On host) .ASS xx WF .TRANSF WF:TRANSF.COM/T WF:TRANSF.COM .@WF:TRANSF This sequence assigns WF to some device and transfers WF:TRANSF.COM to the host. Then the command file is run to trans- fer all the files you specified from the remote to the host. HOST -> REMOTE (While on host - assuming that CSICMD and PARSE are already there) .ASS xx WF .IND CSICMD TRANSF/NEW SD3:*.(SAV,EXE) DU3:/T/S EXE DEL This will prepare a command file on the host system called WF:TRANSF.COM which will specify newly-created .SAV and .EXE files. The command file will be deleted when it finishes. The file will be executed immediately. The file will look as follows: r TRANSF DU3:File1.SAV=DDn:File1.SAV/T/S DU3:File2.SAV=DDn:File2.SAV/T/S ... DU3:FileN.EXE=DDn:FileN.EXE/T/S ^C DELETE/NOQ WF:TRANSF.COM where DDn: is the physical device specified by SD3:. TRANSF will report informative messages because the /S switch was used. The file CMDIND.UCJ contains UCL+ symbol definitions for invoking CSICMD. On a "host" machine you would use either FRMHST or FRMREM to transfer files FRoM the HoST to the remote or FRoM the REMote to the host. On a "remote" machine you would use either TOHOST or TOREM to build (but not execute) a command file which must first be transferred to the host before executing. CMDIND.DOC - Page 5 CMDIND.UCJ UCL+ Symbol Definitions for IND Control Files FRMHST==IND SY:CSICMD.IND TRANSF^3 ^1 ^2/t/s EXE DEL FRMREM==IND SY:CSICMD.IND TRANSF^3 ^1/t ^2/s EXE DEL TOHOST==IND SY:CSICMD.IND TRANSF^3 ^1/t ^2/s NOEXE DEL TOREM ==IND SY:CSICMD.IND TRANSF^3 ^1 ^2/t/s NOEXE DEL