User manual
Chapter 13: ESS for SAS 75
M-x SAS
Four buffers will appear on screen:
Buffer Mode Description
‘foo.sas’ ESS[SAS] your source file
‘*SAS:1*’ iESS[SAS:1] iESS communication buffer
‘*SAS:1.log*’ Shell ESStr [] SAS log information
‘*SAS:1.lst*’ Shell ESSlst [] SAS listing information
If you would prefer each of the four buffers to appear in its own individual frame,
you can arrange for that. Place the cursor in the buffer displaying ‘foo.sas’. Enter the
sequence C-c C-w. The cursor will normally be in buffer ‘foo.sas’. If not, put it there and
C-x b foo.sas.
Send regions, lines, or the entire file contents to SAS (regions are most useful: a high-
lighted region will normally begin with the keywords DATA or PROC and end with RUN;),
C-c C-r.
Information appears in the log buffer, analysis results in the listing buffer. In case of
errors, make the corrections in the ‘foo.sas’ buffer and resubmit with another C-c C-r.
At the end of the session you may save the log and listing buffers with the usual C-x C-s
commands. You will be prompted for a file name. Typically, the names ‘foo.log’ and
‘foo.lst’ will be used. You will almost certainly want to edit the saved files before including
them in a report. The files are read-only by default. You can make them writable by the
emacs command C-x C-q.
At the end of the session, the input file ‘foo.sas’ will typically have been revised. You
can save it. It can be used later as the beginning of another iESS[SAS] session. It can also
be used as a batch input file to SAS.
The ‘*SAS:1*’ buffer is strictly for ESS use. The user should never need to read it or
write to it. Refer to the ‘.lst’ and ‘.log’ buffers for monitoring output!
Troubleshooting: See Section 13.7 [iESS(SAS)–Common problems], page 75.
13.7 iESS[SAS]–Common problems
1. iESS[SAS] does not work on Windows. In order to run SAS inside an emacs buffer, it
is necessary to start SAS with the -stdio option. SAS does not support the -stdio
option on Windows.
2. If M-x SAS gives errors upon startup, check the following:
• you are running Windows: see 1.
• ‘ess-sas-sh-command’ (from the ESS ‘etc’ directory) needs to be executable; too
check, type M-x dired; if not, fix it as follows, type M-:, then at the minibuffer
prompt ‘Eval:’, type (set-file-modes "ess-sas-sh-command" 493).
• sas isn’t in your executable path; to verify, type M-: and at the minibuffer prompt
‘Eval:’, type (executable-find "sas")
3. M-x SAS starts SAS Display Manager. Probably, the command sas on your system calls
a shell script. In that case you will need to locate the real sas executable and link to
it. You can execute the UNIX command:










