Interactive procedures in SAS

2

SAS software supports two kinds of procedures: interactive and non-interactive. Most SAS procedures are non-interactive. They begin with a PROC statement, include one or more additional statements, and end with a RUN statement. When SAS encounters the RUN statement, the procedure executes all statements, then exits.

On the other hand, an interactive procedure does not exit when it executes a RUN statement. There are two kinds of interactive procedures: fully interactive and partially interactive.

  • A fully interactive procedure executes each statement as it is submitted. (Sometimes it executes blocks of statements, such as when executing a DO loop or an IF-THEN/ELSE statement.) In a fully interactive procedure, the RUN statement is either not supported or has a different behavior. The procedure continues to run until it encounters the QUIT statement. Examples of fully interactive procedures in SAS include PROC SQL, PROC IML, and PROC OPTMODEL.
  • Partially interactive procedures execute blocks of statements at a time. The RUN statement delimits the end of the block. Consequently, the blocks of statements are called RUN-blocks or RUN-groups. After executing a RUN-group, the procedure does not exit. When you are finished with the procedure, submit the QUIT statement. Procedures that support RUN-group processing include PROC DATASETS, PROC REG, and PROC ARIMA.

The SAS documentation does not include a list of the interactive procedures. In fact, for some procedures they documentation does not emphasize the fact that they are interactive, which makes it difficult to compile such a list.

This article is my attempt to list all the interactive procedures in SAS. This article focuses mainly on SAS 9 procedures. In general, I do not include deprecated procedures or older procedures that have modern replacements (such as PROC TRANTAB), but I do briefly mention PROC GPLOT and its SAS/GRAPH siblings.

Although I am familiar with many traditional SAS products, there are many procedures that I have never used. If I have omitted an interactive procedure, post a comment so I can update the list!

Special considerations for interactive procedures

If you plan to use an interactive procedure, be aware of the following issues:

A list of interactive procedures in SAS

The following lists specify the interactive procedures in SAS. It is organized by products. Because SAS is always adding new procedures, this list might not be comprehensive. If you know about an interactive procedure that is not on this list, post a comment. I have focused on SAS 9.4, but I include a few important Viya procedures such as PROC ASTORE and PROC CAS.

If a procedure does not specify otherwise, it is partially interactive, which means that it supports RUN-group processing. I explicitly note which procedures are fully interactive.

Interactive procedures in BASE SAS

  • The CATALOG procedure
  • The DATASETS procedure: The interactive nature of PROC DATASETS is a different from other SAS procedures. The documentation states that it supports RUN-group processing, but "the DATASETS procedure supports four types of RUN groups.... Some statements in PROC DATASETS act as implied RUN statements because they cause the RUN group preceding them to execute."
  • The DOCUMENT procedure
  • The DS2 procedure
  • The FEDSQL procedure is fully interactive.
  • The GROOVY procedure
  • PROC GPLOT and other traditional SAS/GRAPH procedures (for example, GBARLINE and GCHART) are partially interactive. These procedures are mostly replaced by the newer SG procedures (for example, SGPLOT), which are not interactive.
  • The SCOREACCEL procedure is an interactive procedure that provides an interface to the CAS server and external data sources for publishing and scoring predictive models.
  • The SQL procedure is fully interactive.
  • The TEMPLATE procedure is not interactive, but the SOURCE statement is interactive.

Interactive procedures in SAS/ETS

The following SAS/ETS procedures support RUN-group processing:

Interactive procedures in SAS/QC

The following SAS/QC procedures support RUN-group processing:

Interactive procedures in SAS/STAT

The following SAS/STAT procedures support RUN-group processing:

Other interactive procedures in SAS

The following procedures are fully interactive:

  • The IML procedure supports a complete programming language for performing a wide variety of computational tasks. The procedure is fully interactive. Blocks of statements are executed as they are submitted. The RUN statement is re-defined to run user-defined IML modules.
  • The OPTMODEL procedure supports a specialized language for solving a wide variety of optimization problems. The procedure is fully interactive. The RUN statement is ignored by PROC OPTMODEL.

In addition, the following procedures are interactive:

  • The ASTORE procedure in SAS Viya is fully interactive. Each statement is executed immediately.
  • The CAS procedure in SAS Viya supports RUN-group processing.
  • The CASUTIL procedure in SAS Viya is fully interactive.
  • Enterprise Miner procedures: The ARBOR procedure and the NEURAL procedures require a license for SAS Enterprise Miner. They are interactive, but they are not intended to be programmed directly. Instead, they are called from the Enterprise Miner GUI.
  • The OLAPOPERATE procedure enables you to connect to and manage an OLAP server.
  • SAS/OR project management procedures: The CPM, PM, and DTREE procedures are interactive.

Summary

This article provides a list of the interactive procedures in SAS. An interactive procedure does not exit until it encounters a QUIT statement. Fully interactive procedures execute statements as they are submitted. Partially interactive procedures support RUN-group processing.

Not every interface to SAS supports running procedures interactively. The old SAS Windowing system in SAS 9 supports interactive programming. The Interactive Perspective in the SAS Studio interface also supports interactive programming. Enterprise Guide does not support it.

Share

About Author

Rick Wicklin

Distinguished Researcher in Computational Statistics

Rick Wicklin, PhD, is a distinguished researcher in computational statistics at SAS and is a principal developer of SAS/IML software. His areas of expertise include computational statistics, simulation, statistical graphics, and modern methods in statistical data analysis. Rick is author of the books Statistical Programming with SAS/IML Software and Simulating Data with SAS.

2 Comments

Leave A Reply

Back to Top