Unlike MVS, the SAS® system
does not provide a front-end that VMS users can easily customize.
The result has been many VMS sites writing lengthy command procedures
using DCL (Digital Command Language.) These are far from intuitive
and are difficult to support. A more powerful alternative is
using the Command Definition Utility (CDU) to create your own DCL SAS verb. [SAS's version of this can be found in
However, the documentation to do this is in several DEC manuals
and examples (especially with C) are sparse. This paper attempts
to demystify this process by creating a simplified annotated DCL
verb. References for further information are provided. Once you
understand the framework and have an example to work from, you
can then build your own DCL front-end.
The following are steps to create a Command Language definition file:
Figure 2 shows a general command
procedure (.COM file ) that allows you to run steps 1-5 by just
entering one command. Just enter
RUNIT program at the DCL ($) prompt. (With program
the name of your C program and command.) This results in program
being assigned to the P1 symbol. (I use the /LIST and /SHOW qualifiers
to assist in the inevitable debugging of the C program. These
produce a program listing of program.lis that contains
intermediate macro expansions.)
Figure 1 shows the overall process:

RUNIT.COM
$ cc 'P1'.c/list/show=(intermediate)
$ link 'P1
$ set command 'P1'.cld
$ 'P1
The remainder of the paper discusses
in greater detail the components used to create a new DCL verb.
The .CLD is a text file that sets
the boundaries of a verb. The basic syntax is fairly
simple. Figure 3 lists the skeleton of a valid .CLD file:
To help clarify this, a simple example is provided.
Let us create a new DCL verb called
NAME that will use all of the above. (This example will be used to discuss the other CDU elements as well.)
Figure 4 lists the .CLD file used
to create this verb:
What is going on here is quite simple:
Thus the following are possible
sessions using the NAME verb:
NAME
_Your First Name: PROC
_Your Last Name: REPORT
F: PROC L :REPORT
NAME
_Your First Name: PROC
_Your Last Name:
F: PROC L:SMITH
NAME /MIDDLE=THE MACK KNIFE
_Your First Name: MACK
_Your Last Name: KNIFE
F: MACK M: THE L:KNIFE
Space does not permit a discussion of other components of the .CLD file such as DEFINE SYNTAX (Use to modify an already defined verb), and DEFINE TYPE (Define values for syntax, values, labels, etc).
Keep the following in mind when creating a .CLD to be used as a SAS front-end:
define type names
keyword....
(later on)
qualifier name value=(type=names,required)
qualifier mess negatable
3. The fun part -- the C program.
Even if you are knowledgeable in
C, creating a C program to process the result from a .CLD file can
be a frightening experience. Two components particularly can cause this anxiety -- 1) use of string descriptors, and 2) CLI run time procedures. Each will be briefly discussed.
Strings in VAX C are represented
by string descriptors which are really data structures containing
the address type, length, and class of the string. The problem
is that VMS C has no direct way to pass by descriptor. Instead,
you have to face the ugly and unnerving task of building your
own string descriptors. The clearest explanation on this topic
can be found in the May 1990 Issue of DEC Professional (pages 132-140)
There are 4 major CLI (Command
Language Interface) routines. We will only be discussing two of them:
CLI$PRESENT(qualifier).
Returns if a qualifier is present. This will always be true if the qualifier is the default. (Unless a negatable version of a qualifier is used such as /NONUKES.) Results are placed in the variables CLI$PRESENT or CLI$NEGATED.
CLI$GETVALUE(input string,
output string,length of string). This values processes a string and returns an output string. Results are placed in the SS$NORMAL variable.
We are now ready to look at the
NAME.C program.
We've already mentioned about SET
command used to create the DCL verb. This section just mentions
the qualifiers that you can use with this command.
/DELETE Deletes a verb
/LISTING Give an output listing
/OUTPUT Specifies the command table file.
/REPLACE Replace a verb.
/TABLE Specifies command table to
use.
This can only be a brief introduction
on the major issues in creating a front-end using the Command
Definition Utility (CDU). By using the simplified framework, one can have the courage to look at the various DEC manuals (see below) and start building your own DCL verbs.
Getting in touch with me/Trademarks
Hallett German
GTE Laboratories Inc
40 Sylvan Road
Waltham, Ma 02254
617-466-2290
Mail to me
SAS ® and all other SAS products
mentioned is a registered trademark of the SAS Institute
VAX, VMS, DCL, and DEC are trademarks
of the Digital Equipment Corporation.
References [Annotated]
[Since the information on building
a DCL Verb in C is not in one place, I have described what each
reference contains.]
Digital Equipment Corporation VMS
Command Definition Utility Manual 1988 (Volume 2B
[Describes the .CLD file components
and SET Command.]
Digital Equipment Corporation VMS
Librarian Utility Manual 1988 (Volume 2B)
[Describes the LIBRARIAN command
and HELP libraries.]
Digital Equipment Corporation VMS
Message Utility Manual 1988 (Volume 2B)
[Describes the MESSAGE command and
the message source file components.]
Gibes, Kernon "A VAX/VMS Command
for SAS/Batch Jobs" SUGI 14 Proceedings 1989 pp. 1497-1501
[Kernon does a good job describing
building your own SAS DCL verb and covers some of the above. His
program was written in FORTRAN and has provided source in the
past. Also describes building your own foreign DCL interface which
is not described in this paper.]
Jaeschke, Rex "String Descriptors"Digital Review
May 1990. pp. 132-140
[I found the DEC manual on this
topic less than friendly. I suggest look at the DESCRIP file and
reading this article. Rex has a regular column on C, C++,
and VMS that I recommend
reading]