The Grand Alliance: Using TSO/E CLIST and REXX Command Languages in the SAS® Program Development Cycle

Hallett German, GTE Laboratories Inc.



Copyright (c) 1990 All Rights Reserved

Return to Home Page Publications


A. Introduction

Over the years, many papers have been presented at both SUGI and NESUG on using CLISTs and REXX execs to supplement the features found in the SAS® System. By synethisizing the information presented in these works, we can begin to develop a simple model showing where any command language can be used in the SAS program development cycle. The presentation in Boston will demonstrate some coding sequences suggested by the model. (Note: All statements about REXX refer to the 1985 edition of Mike Cowlishaw's The REXX Language: A Practical Approach to Programming. A later edition was just released and I have not obtained a copy of it to date.)

B. What is a Command Language?

A command language can be found in all major computer operating systems. In simplest terms, it allows the user to interactively issue a series of English-like commands tohave the operating system perform several tasks. Reviewing what these tasks are crucial in developing our simple model. (As a side note, I hope to begin soon writing something long overdue, a "one-stop" reference book on the major command languages.) Table 1 has a list of the major command languages and which operating system they can be found under:

Table 1: Major Command Languages and their Operating Environments

CLISTTSO (MVS), DOS
REXXTSO (MVS), DOS, Windows
DCLVMS, DOS
Various Shells (UNIX) UNIX, DOS, OS/2
PerlUNIX, DOS, Amiga, Macintosh, OS/2
Batch (DOS) DOS, OS/2

C. CLISTS and Execs with SAS: Major Tasks

The following are the two major tasks which clists and REXX execs perform:

1. Housekeeping Clists/Execs

Programs such as SAS often need a clist or REXX exec to perform the necessary "housekeeping" tasks and then be invoked. A typical sequence would be:

* FREE the datasets you want to use if currently allocated.

* DELETE temporary datasets and FREE them just in case.

* ALLOCATE all needed datasets (In SAS this is usually a partitioned dataset

containing as members the program and the dataset.)

* EXECUTE the program (such as SAS.)

I also place in the same category clists or execs that perform system tasks (such as compressing a PDS.) A good deal of SUGI datasets used CLISTs and REXX execs in such a matter. Note that clists can directly contain the TSO commands that perform the housekeeping tasks but REXX execs must use the ADDRESS instruction to do this.

2. Application Clists/Execs

CLISTs and REXX execs can use a variety of other environments to provide a self-contained applications. Table 2 lists the environments and the way they are invoked in other environment:

Table 2: Other Environments CLIST and REXX

Environment Features How Invoked - CLIST How Invoked - REXX
ISPFFull-screens with input validations, simple database, command file I/O Enter the ISPEXEC command directly in the clist. Use the ADDRESS instruction with ISPEXEC as the first argument. (1)
PDF Edit Macros Editing Functions and compiled language extensions. Enter the ISREDIT command directly in the clist. Use the ADDRESS instruction with ISREDIT as the first argument. (1)
Session Manager Recall previously entered commands. Similar to UNIX Shell command line operations. The Session Manager commands go directly into the clist. Place multiple windows in a SMPUT statement. The ADDRESS instruction with TSO as the first argument.
Compiled Programs Faster operation, greater numerical precision. CALL command directly in the clist. The ADDRESS instruction with LINK as the first argument. CALL instruction for compiled external functions.
Other Clists Modular programming, value passing Clist name if in clist. EXEC clistname CLIST from ready with clistname part of the SYSPROC concatenation. The ADDRESS Instruction with TSO as the first argument and exec clistname CLIST as the second argument.
Other Execs Modular programming EXEC execname EXEC from READY with execname part of the SYSPROC or SYSEXEC concatenation. CALL instruction for external functions.

(1) You must convert your ISPF command to uppercase.

D. Clists and Execs with SAS: Additional Tasks

Clists and Execs also can do more than the above when working with the SAS system. Table 3 lists these additional tasks:

Table 3 Additional Tasks Performed by Clists and REXX Execs

TASKHOW TO DO IT
Generating SAS Programs
(including macros)
CLIST QSAM functions
REXX EXECIO instruction.
PDF Edit Macros
ISPF Skeletons
(See German, 1989 for more information)
Modifying Raw Data (small datasets)
Same as Generating SAS Programs
Full-screen applications ISPF with or without SAS/DMI
(Or just use SAS/AF and SAS/FSP.)
Invoking SAS and changing the SAS client operand values With clist, invoke SAS with operand values as symbolic values.

With REXX, build a subroutine that loops through the SAS clist line and parse the appropriate values.

E. A Tentative Model of Clist and Exec Use with SAS.

With all the above in mind, it is easy to devise a general model showing where any command language can be used in the SAS program developmernt cycle. Table 4 shows this model. I hope that future NESUG and SUGI presentations will revise and expand this model.

Table 4 Model of CLIST and Exec Use with SAS

ElementKey Tasks How to use a command language
DEFINITION/PROTOTYPEWhat will my SAS data look like? What will my SAS program look like? A simple clist or exec to generate and manipulate your SAS program or data to the desired result.
APPLICATIONExpanding a program with a front-end to be used by multiple users. Building a front-end during data extraction and reporting with SAS. Housekeeping and applications programs.
DEBUGGINGWhy does this feature not work? Manipulate data, generate and maintain different versions of the program.
DOCUMENTATIONHow does it work? Housekeeping tasks
IDEA GENERATIONWhat could be a future project? Build a simple prototype, perhaps with ISPF screens


F. Conclusions

Once understanding what a command language is and the task it performs , we could create a general model on how they can be used in the SAS development cycle. By providing an easy means to perform system tasks, command languages are indispensible to the SAS System and together form a "grand alliance" for years to come.

G. Getting In Touch with Me

I will be glad to send you the handout from the presentation or talk to you further on this matter. Here's how to get hold of me:

Electronic mail:

NESUG BBS: Hal German (I read the Boston board on a more frequent basis.)

Mail: GTE Laboratories, 40 Sylvan Road, Waltham Ma, 02254

H. References

Cowlishaw, Michael F. The REXX language: A Practical Approach to Programming 1985 Prentice-Hall, Englewood Cliffs, New Jersey

Denney, Michael J. "The SAS System Under CMS: Tricks of the Trade." Proceedings of the Twelth Annual SUGI Conference 1987 pp. 974-7

German, Hallett TSO/E Clists: Basics, Applications, and Advanced Techniques 1990 Van Nostrand Reinhold, New York, New York pp. 67-68, 455-459

German, Hallett "Using TSO/E Clists and ISPF for Generating SAS Programs" Proceedings of NESUG '89 pp 67-73