The dcl command allows you to put VMS DCL commands in your procedure, which are not portable. The corresponding command under UNIX is ush, which allows you to execute shell commands inside the procedure.
In order to use the dcl or ush commands, there has to be some way of determining which operating system you are on. A global variable called “$syschar” holds the type of operating system. Index 1 in this variable is either “UNIX” or “VAX_VMS”. For example:
procedure parm file string refgbl $syschar body if ($syschar(1) = "UNIX") ush rm &file else dcl delete &file end-if end-proc
Unfortunately, there appears to be no straightforward way to determine the particular version of UNIX, so use common shell commands.
Another major trouble area for TCL is filenames. Filenames and path names look much different under VMS and UNIX. There is a lot of TCL code in VICAR that parses filenames, appends filenames to directories, etc. Many test scripts use hardcoded VMS directories and filenames to find test files. All of these will have to change. The same “$syschar” variable can be used to do different things with the filename, or pick different testfiles, based on which system you are using.
The “$syschar” variable may also be tested inside help files, help within a PDF, and menus via special conditional commands. These commands are part of TAE, but they are not documented by TAE. The conditionals test to see if the given string is in any element of the “$syschar” variable. Like other PDF/MDF directives, they should appear on a line by themselves with period “.“ in the first column:
The following example is taken from the TAE command mode help file (commode.hlp):
CONT*INUE .if VAX_VMS DCL any-VMS/DCL-command DCL-NOINTERRUPT any-VMS/DCL-command .ifend DEFC*MD COMMAND=command-name STRING=replacement-string ... T*UTOR-NOSCREEN PROC=proc-subcmd parameters .if1 UNIX USH any-UNIX/shell-command WAIT-ASYNC JOB=job-name-list ... RUNTYPE Command Qualifier (continued) If the command qualifier is set to BATCH, the following TAE message is displayed: .if VAX_VMS Job (nnn) submitted to queue (que) where "nnn" is the assigned job number and "que" is the name of the queue the job was submitted to. .elseif UNIX Batch job file "filename" submitted successfully. where "filename" is the batch job file name, defined as "proc".job. .ifend
Refer to the TAE documentation if you have more questions on writing portable TCL.