THE ADVENTURE CONTINUES:

USING CLIST, DOS BATCH LANGUAGE,

DCL, AND REXX COMMAND LANGUAGES

IN THE SAS® DEVELOPMENT CYCLE

Hallett German

GTE Laboratories, Inc.


Copyright (c) 1991 All Rights Reserved

Return to Home Page Publications


Overview of Recent Events

The area of command languages has been rich in activity since I built my first command language application seven years ago. The following are what I believe are the current major trends for command languages:

* There is consistent growth in the number of new command language interpreters introduced each year.

This includes new DCL, REXX, and Mac-based command language interpreters.

In addition, these interpreters are appearing on an increasing number of operating systems and environments.

Command languages available on a variety of platforms include Batch language (BAT), CLIST, DCL, Icon, Python, REXX, Perl, and various UNIX shells.

This means that portability and interoperability of command language programs across operating systems are increasingly becoming a real concern for many programmers.

* Command language compilers are appearing resulting in faster run times. Compilers are available for Icon and REXX and are being vigorously requested for other command languages.

* Command languages standards are starting to appear such as UNIX shells (POSIX 1003.2) and REXX (ANSI X3J18).

* Graphical User Interface-based (GUI) environments such as MS Windows®, X Windows, and Macintosh® OS are beginning to have command languages available such as Bridge, Visual BASIC, and Frontier.

* 1992 will mark the appearance of the first "one stop" reference on the major command languages (Batch, CLIST, DCL, Perl, and REXX) written by the author and published by Van Nostrand Reinhold. Included are sections on portability of command language commands across operating systems, extending each command language, and choosing a command language (including comparison charts and benchmarks). The appearance of this book is hoped to further interest in command languages.

NESUG and Command Languages

NESUG also has a history of being involved with command languages:

* This year, for the first time, has sponsored a "SAS and Command Language" course given November 1st at Pace University Graduate Center by the author.

Has had a Host Systems section since 1989. Table 1 shows the breakdown by command language for Host Systems (and talks that mention command languages but were in other sections).

Table 1 Breakdown of NESUG Command Language Talks 1989-1991
General German(1991)
Batch (OS/2) Darden(1990 )
(DOS) Greenleaf & Kalyandrug(1989)
CLIST German(1989,1990), Vye and Dickstein(1989)
DCL Strekel(1989) Vizard(1990)
REXX German(1990) Gleason(1989)

Lee(1990)

Whitley(1991)

UNIX Script Painter(1990)

Since NESUG '89, I having been presenting information on how to take advantage of this "grand alliance" -- in developing the right type of application the first time. (For the record, I've been accused of knowing seven command languages but there are only six that I will acknowledge!)

Last year, I presented a model that showed how command languages can be used anywhere in the SAS development cycle. Knowing the type of application determined the tasks to perform and corresponding commands to do them. This paper, builds on last year's effort and does a selective content analysis of past SUGI presentations to tap this important information resource.

[A version of this paper was presented for the Boston Area SAS Users Group earlier this year. The presentation at NESUG 91 will be topics entirely different from this paper:1) choosing a command language, 2) command language tips and traps, and 3) command language style. Copies are available on request.]

Command Language Presentations at SUGI (1981-1989)

The above years were picked as a sample of convenience. (Ok, I confess they were the proceedings I had lying around the office.] One could make the claim that study of SAS and command languages mirrors the growth of the SAS system. Table 2 shows some of these trends by years. Keep this framework in mind as we discuss SUGI papers a little later on.

Table 2 Trends in command language papers at SUGI
1981-1985 The height of "SAS on the mainframe frenzy." Talks were on front-ends or applications using CLIST and ISPF (TSO), or EXEC2 (CMS)
1986-1989 A greater diversity of SAS and command language talks:

- Using DCL as a "macro"

language.

- Using batch files for front-end to SAS

- Using UNIX shells to pipe data to/from SAS programs

1990s Command language presentations appear to be on the decline due to the arrival of some SAS products that do the same thing.

Some talks on building

applications across multiple operating systems.

To begin tracking down the number of SUGI SAS and Command Language articles is a difficult task. For example, an article on a SAS TSO CLIST application may be found under Command lists, CLISTs, ISPF, TSO CLISTS, TSO/E CLISTS, MVS. The best way to track down articles is to use the master index as a starting point, followed by the index of the specific proceeding, and ending up looking at the table of contents for a specific proceeding. Using only one of these is usually not sufficient.

Table 3 presents a breakdown of presentations given between 1981 and 1989 at SUGI. The first column represents the articles mentioned in the SUGI master index. The second column represents the articles mentioned in the index for the specific proceeding.

Table 3 SUGI Command Language Presentations

1981-1989
Topic Master Index Index Each Year
General 2 1
Batch 05
CLIST 722
DCL 36
REXX 26
UNIX Shell 1 1

The remaining part of this paper will discuss 1) various tips and recommendations these presenters made, 2) some questions to ponder about SAS and command languages.

SAS and Command Language Applications

At last year's NESUG, I proposed that all command language applications can be divided into two topics:

*Housekeeping Applications

For some environments, SAS needs a command language program to perform "housekeeping" (such as allocating a dataset) before being invoked. Also placed under this category were system utilities (such as archiving datasets/files) and login scripts.

*End-User Applications

By using other environments, command languages can be used to produce user-oriented, full-screen self-contained applications.

Each command language application developed by SUGI presenters fits into one of these two categories. Space does not permit me to list references by category

Tips from Past SUGI papers

The following are some of the tips, traps, and

conclusions reached by SUGI command language presenters: [Comments in brackets are mine.]

Batch Files

*Hofacker and Hoffman(1986) mention applications can interoperate between PC-DOS and VM if using SAS/RTERM, VM/Bond and REXX.

*Landon(1986) uses the technique of having a menu where the user selection is the name of the batch file invoked which sets up the proper path and data files. [With the arrival of the CALL command in DOS 3.3, invoking nested batch files and returning from them became much cleaner.]

* Young(1988) notes that file compression can reduce SAS and other files by 10-20%, [Young was using ARC. Later compression utilities would probably yield higher rates. He uses the ECHO command to provide a value to CHKDSK (ECHO N | CHKDSK /F). He also employs FIND to find a string in one file and redirect it to another (FIND "SAS" TEXT.TXT > TEXT2.TXT) [With DOS 5.0, FIND can now search for case-insensitive arguments.]

*Davis and Sweetland(1987) mention that the CHKDSK/F command should be placed in the batch file that invokes SAS. They mention how batch files (with PATH statement) can be used to customize the SAS environment.

* Economou (1989) uses a variety of interesting techniques. These include: 1) IF EXIST dataset ...COPY (implied then), 2) BASIC program to set printer top of form, and 3) sort directory before backup.

CLIST

This is just a sample of the many tips on CLISTS:

Tilanus et al (1982) report that SAS, CLISTs, ISPF, and SAS/FSP are a good combination for prototyping. They also use the ISPF system variables &ZUSER to "remember" who the current user is. ISPF table and file tailoring service were also used.

Dickinson(1982) built CLISTs that users used as commands to invoke and process SAS programs. This saved the user worrying about such things as the syntax of the ALLOC command. However, ISPF panels were also available. This gave users a choice on the interface to use. Porting to EXEC2 on CMS was also mentioned.

Timmins and Lucke(1982) used the CLIST QSAM facility to build a control file used to determine which SAS macro to invoke.

LaRue(1982) makes the following observations: 1) Where a CLIST library is allocated in a SYSPROC concatenation means everything, 2) Use a READ following by 26 variables to set a title. [For current CLIST users, the following sequence would reduce "variable rot."]

READ

SET &TITLE=&STR('&SYSDVAL')

Hudson and McBride(1982) has a good definition of end-user command language applications

"Allows the user to function in a conversational mode

with the system while maintaining strict control over

data entry"

Sauer and Allee(1986) offer these tips when using TSO commands in SAS macros:1)Use TSO commands in CLISTs [and now EXECs] instead of %TSO and X statements to suppress operating system messages. 2)Use the macro variable SYSRC and the CLIST EXIT statements to pass the result of a TSO command back to the SAS system.

Suchoski and Magnuson(1986) used the return code based on ACF protections to see if a user could use a CLIST.

Folsom(1986) invoked SAS and then passed the program as part of a DATA-ENDDATA structure.

Corcoran(1986) Coded a SUBMIT * followed by the JCL statements to build and submit a JCL program at run-time.

DCL

Blaylock and Salvo(1985) [Back in the days where SAS macros on VMS were only a future enhancement. used an INQUIRE to capture values then wrote them out to a file. [Note the preferred method is to use READ. INQUIRE converts input to uppercase and symbolic substitution can also unexpectedly take place.]

Khoury and Laskarzewski (1985) used the F$SEARCH lexical function to search for a dataset before deleting it. A series of WRITE statements translated the data. [Would the availability of F$FAO (formatted output) lexical function back then have changed the look of this program?]

Rhoads(1988) discusses how to build a command procedure to submit SAS batch jobs. This one of several papers on this topic. [To me, it seems more efficient to create your own SAS DCL verb such as Gibes(1989). If you look at SAS system libraries, this is the way the SAS image is currently invoked.]

Oakley(1987) is interesting because both an IBM and VMS solution are presented for the same problem. She has a good example of how to conditionally include SAS statements [Before the days of VMS SAS macros. ]

Martin(1989) has a COM file used to monitor who is using SAS.

Cantrell and Wahl(1989) is interesting to note in passing as a case of an application converted from CLIST to DCL.

REXX

REXX remains the one language available on nearly all the platforms that the SAS system is. (This includes DOS, OS/2, CMS, TSO, MVS, UNIX, and possibly soon VMS.) Here are some tips and guidelines in using REXX:

Lahr(1989) The user just presses enter and REXX does the rest...

Siu and Johnson(1989) uses a REXX program to update a master database and checks if any users of the system are still logged on.

Day and Keyser (1989) used REXX to create a SAS dataset (using the almost portable EXECIO.) This could not be easily done using SAS.

Gleason (1989) dreams of a UNIX REXX interpreter [available today from the Workstation Group] and the desire to port REXX wherever SAS is. His 1987 article gives a good overview of REXX across various environments and discusses the desire for a REXX SAS interface.

LeBlanc(1988) Uses REXX to access the SAS sample library. He does a LISTFILE of all files with a type of HELPMSG. The titles from each file are then extracted and written to a file.

Pan(1988) placed REXX values into SAS variables. No code is shown doing this.

James et al. (1986) is one of the first REXX papers presented at SUGI. It also mentions replacing CLISTS that were nothing more than a series of questions with SAS/AF.

Burlew(1987) used REXX calling XEDIT to run a specified sample library member.

Denney(1987) presents a variety of REXX tricks including invoking SAS/FSP and integrating SAS HELP with CMS help.

UNIX

Last but not least to the SAS/Command Language world are UNIX shell languages. A variety of shells are available. The command language for system administrators appears to be Perl (Practical Extraction and Report Language.) Future NESUG and SUGI talks should discuss how to use Perl with SAS. It is also available on the Amiga, DOS, and OS/2. Here are a few tips on UNIX shells and SAS:

Ziegler, Betancourt, and Kelly(1988) is one of the first paper presented at SUGI that discusses SAS on UNIX platforms. Examples of the interaction between SAS, system commands, and external scripts are shown.

Betancourt(1989) has a good example where he does a file listing, redirects it to a file which is then processed by SAS.

Johnson(1989) also shows how you can pipe output

to or from a system command (or a command language script.) This fits well with UNIX's philosophy of combining tools serving as filters (via pipes and redirects) to get a job done.) Examples are also provided passing parameters between a script and a SAS program.

Thoughts to Ponder

Unfortunately, this can only be a subset of the good information presented from past SUGI papers. I hope it encourages future investigators to look at this area. I leave you with the following questions to ponder:

* Are command languages really needed for SAS applications anymore with the arrival of SAS/AF (and SCL),SAS/ASSIST, and SAS/EIS?

* If yes, then is it time for SAS to support a standard command language across all platforms and perhaps include an interface to that command language? (The best candidate so far is REXX.)

Will command languages successfully make the transition as support tools to graphical user interfaces?

Will Microsoft's desire to push Visual BASIC and Quick BASIC hurt the future of REXX?

Will the forthcoming REXX standard make any difference?

Is the portability of command languages still a concern any more?

Getting in touch with me/Trademarks

Hallett German

GTE Laboratories Inc

40 Sylvan Road

Waltham, Ma 02254

617-466-2290

hhg1@bunny.gte.com

SAS ® and all other SAS products mentioned is a registered trademark of the SAS Institute

UNIX® is a registered trademark of ATT

Windows, MS, and DOS are trademarks of Microsoft

CMS, ISPF, OS/2, and TSO are trademarks of IBM

VAX, VMS, DCL, and DEC are trademarks of the Digital Equipment Corporation.

References

Betancourt, Randy "Using the SAS System for Controlling Distributed Processing under UNIX and PC DOS" SUGI 14

Proceedings 1989 pp. 1630-1636

Blaylock, Dewey and Salvo Larry " An Environmental Data System using SAS Software on the VAX 11/780" SUGI 10 Proceedings 1985 pp. 675-678

Burlew, Michele "Accessing SAS Software Sample Program Libraries Using CMS REXX" SUGI 12 Proceedings 1987 pp. 966-967

Cantrell, Casey and Douglas Wahl "Exploiting SAS System and DCL System Features to Replicate an MVS CLIST Management Reporting System under VMS" SUGI 14 Proceedings 1989 pp. 782-785

Corcoran, Chris "SAS and the IBM Dialog Manager at Miles

Pharmaceuticals" SUGI 11 Proceedings 1986 pp. 587-592

Day, Bob "A Quick and User-Friendly Comprehensive Front-end for the SAS/GRAPH Procedures " SUGI 14 Proceedings 1989 pp. 1467-1471

Darden, Sarah "The SAS System Under OS/2" NESUG 90 Proceedings 1990 pp. 206-209

Davis Gordon and Scott Sweetland "Efficiency and Performance Considerations for the SAS System under PC DOS " SUGI 12 Proceedings 1987 pp. 779-787

Denney, Michael "The SAS System Under CMS: Tricks of the Trade" SUGI 12 Proceedings 1987 pp. 974-977

Dickinson(1982) "A General Purpose TSO Interface

To SAS Using SPF" SUGI 7 Proceedings 1982 pp. 454-459

Economou, Tenya " A PC Menu-Driven System: Integrating the SAS System for Personal Computers with DBASE III PLUS and DOS Batch Files" SUGI 14 Proceedings 1989 pp. 992-998

Folsom, Todd "A SAS/FSP Software and CLIST System for Easy Management of a Macro invertebrate Reference Collection" SUGI 11 Proceedings 1986 pp. 341- 345

German, Hallett The Command Language Advisor for PCs, Minicomputers, and Mainframes Van Nostrand Reinhold (Forthcoming April 1992)

German, Hallett "The Grand Alliance: Using TSO/E CLIST and REXX Command Languages in the SAS®

Program Development Cycle" NESUG 90 Proceedings 1990 pp. 216-219

German, Hallett TSO/E Clists: Basics, Applications,

and Advanced Techniques 1990 Van Nostrand Reinhold New York, NY

German, Hallett "Using TSO/E CLISTs and ISPF for

Generating SAS Programs" NESUG 89 Proceedings 1989 pp. 67-73

Gleason , Chapman "A CMS VM Batch Facility REXX EXEC for the SAS System" SUGI 14 Proceedings 1989

pp. 673-675

Gleason, Chapman "An Introduction to SAA REXX for SAS Programmers" NESUG 89 Proceedings 1989 pp. 74-79

Gleason,Chapman "Software Mirrors in a Mainframe/Micro

Environment" SUGI 12 Proceedings 1987 pp. 840-857

Greenleaf, Andrew and Sivaram Kalyandrug "Trauma Registry System Using the SAS System and Dbase III Plus" NESUG 89 Proceedings 989 pp. 243-250

Hofacker, Charles and Paul Hoffman "How will PC SAS And Organizations Come to Grips with Each Other?" SUGI 11 Proceedings 1986 pp. 614-6

Hudson, Michael and Roberta McBride "SAS,SAS-ETS, and CLIST: A User-Oriented Approach to Management Reporting" SUGI 7 Proceedings 1982 pp. 505-507

James, Harriet et al. "Techniques Used for Converting An On-Line Production System From a Prior Release of SAS Software to Version 5.0.8 of SAS Software SUGI 11 Proceedings 1986 pp. 453-464

Johnson, Bernadette "The SAS System Under UNIX and Derivative Operating Systems : New Features, New Power" SUGI 14 Proceedings 1989 pp. 1637-1646

Khory, Philip "Converting CLINFO Dataset Sets Into SAS

Datasets" SUGI 10 Proceedings, 1985, pp. 679-683

Landon, Robert "DBASE III to SAS PC DOS - A File Management System" SUGI 11 Proceedings 1986 pp. 623-9

Lahr, Robert "SIR on SSHENET: Developing a Common Student Information Database for 14 Universities and Sharing It Under CMS" SUGI 14 Proceedings 1989 pp. 888-892

LaRue, Dennis W. "Techniques for Creating Special TSO/CMS Commands that Generate and Execute SAS Programs" SUGI 7 Proceedings 1982 pp. 495-500

LeBlanc, William, Robert Syren, Gonzalo Garriga

"On-line Access to the SAS Sample Library, Usage Notes, and Tutorials in VM/CMS" SUGI 13 Proceedings 1988 pp. 1423-1427

Lee, Han-li "Using REXX to Build a Front-end User Interface" NESUG 90 Proceedings 1990 pp. 220-224

Martin, Thomas "Tricks and Tips for Supporting the SAS

System Under VMS" SUGI 14 Proceedings 1989 pp. 507-512

Painter, Sally "The SAS System Under UNIX Operating Systems and Derivatives" NESUG 90 Proceedings 1990 pp. 203-205

Pan, Rong Q. "Use of the SAS System, CMS REXX, and ISPF to Generate Standardized Vital Signs Reports for Clinical Studies" SUGI 13 Proceedings 1988 pp. 881-886

SAS Institute Master Index to SUGI Proceedings 1989 edition

Sauer J. and Allee M. "Development of a SAS Based Interactive System Used to Analyze Pharmaceutical Production Data " SUGI 11 Proceedings 1986 pp. 273-278

Siu, Maria and LuAnn Johnson "Customized Database Management System for Clinical Research Data Using SAS/FSP, IBM DMS Panels, and IBM VM/SP REXX"

SUGI 14 Proceedings, 1989 pp. 1087-1092

Strekel, Giles "Waiting for Version 6" NESUG 89 Proceedings 1989 pp. 87-90

Suchoski, Pamela and Dan Magnuson "SPARES - An Interactive Estimated System Using SAS Software, CLISTSs, ISPF, and COBOL. SUGI 11 Proceedings

1986 pp. 303-309

Tilanus, Erik, Backer and Esselman "Pronto - A System for Maintenance of Duty Rosters of Shift Rosters" SUGI 7 Proceedings 1982 pp. 405-409

Timmins, Pat and Larry Locke " SAS Panels -- Using SAS with the new SPF's Dialog Manager" SUGI 7 Proceedings pp. 466-471

Vye, Christian and Craig Dickstein "SAS Macros and SAS/AF Menu System for reading Compustat Files" NESUG 89 Proceedings 1989 pp. 217-221

Vizard, John "DCL Standards for SAS Applications Running on VMS Host Computers" NESUG 90 Proceedings 1990 pp. 210-215

Whitley, Chris "Interfacing REXX and SAS: Using REXX to Create Front-End Processors for SAS Programs" NESUG 91 Proceedings 1991

Young, James "Strategies for Shrinking PC Data Sets and Finding More Free Bytes" SUGI 13 Proceedings 1988 pp. 613-8

Zeigler,Carl et al."SAS Software for the UNIX Environment" SUGI 13 Proceedings 1988 pp. 46-50