User manual

Chapter 13: ESS for SAS 68
13 ESS for SAS
ESS[SAS] was designed for use with SAS. It is descended from emacs macros developed by
John Sall for editing SAS programs and SAS-mode by Tom Cook. Those editing features and
new advanced features are part of ESS[SAS]. The user interface of ESS[SAS] has similarities
with ESS[S] and the SAS Display Manager.
13.1 ESS[SAS]–Design philosophy
ESS[SAS] was designed to aid the user in writing and maintaining SAS programs, such as
foo.sas’. Both interactive and batch submission of SAS programs is supported.
ESS[SAS] was written with two primary goals.
1. The emacs text editor provides a powerful and flexible development environment for
programming languages. These features are a boon to all programmers and, with the
help of ESS[SAS], to SAS users as well.
2. Although a departure from SAS Display Manager, ESS[SAS] provides similar key def-
initions to give novice ESS[SAS] users a head start. Also, inconvenient SAS Display
Manager features, like remote submission and syntax highlighting, are provided trans-
parently; appealing to advanced ESS[SAS] users.
13.2 ESS[SAS]–Editing files
ESS[SAS] is the mode for editing SAS language files. This mode handles:
proper indenting, generated by both TAB and RET.
color and font choices based on syntax.
ability to save and submit the file you are working on as a batch SAS process with a
single keypress and to continue editing while it is runs in the background.
capability of killing the batch SAS process through the *shell* buffer or allow the
SAS process to keep on running after you exit emacs.
single keypress navigation of .sas’, .log and .lst files (‘.log and .lst files are
refreshed with each keypress).
ability to send the contents of an entire buffer, a highlighted region, or a single line to
an interactive SAS process.
ability to switch between processes which would be the target of the buffer (for the
above).
ESS[SAS] is automatically turned on when editing a file with a .sas suffix (or other
extension, if specified via auto-mode-alist). The function keys can be enabled to use the
same function keys that the SAS Display Manager does. The interactive capabilities of ESS
require you to start an inferior SAS process with M-x SAS (See Section 13.6 [iESS(SAS)–
Interactive SAS processes], page 74.)
At this writing, the indenting and syntax highlighting are generally correct. Known
issues: for multiple line * or %* comments, only the first line is highlighted; for .log
files, only the first line of a NOTE:, WARNING: or ERROR: message is highlighted; unmatched
single/double quotes in CARDS data lines are NOT ignored; in an iterative DO statement, TO
and BY are not highlighted.