[ESS] ESS[SAS]: experience, fixes, and starting questions

Frederico Muñoz |@munoz @end|ng |rom gm@||@com
Sat Jan 27 21:44:34 CET 2024


Hello,

I've used ESS with R before, but I just started with using it for SAS
and I had an initial experience that I'm unsure is due to my lack of
knowledge (and lack of proper understanding of the documentation) or
more related with the status of the SAS support in ESS.

I'm using Emacs 30.0.6, with ESS installed through package.el
(ess-20240122.1720). SAS is SAS 9.4, locally installed in Debian
GNU/Linux (symlinked to /usr/local/bin/sas). My remarks are mostly about
the iESS approach, which is what I was after.

My initial experience with it was that a substantial part of it didn't
work out of the box: opening a test.sas file puts the file in SAS mode
(this part works), but anything that starts the interactive session (M-x
SAS, C-RET, C-z) hangs after splitting the screen in the different
horizontal buffers. Changing some things (like the inferior-ess-program)
give slightly different results, but only superficially: the SAS process
never starts, and each time an evaluation is attempted a new set of
buffers gets created.

My first question is about this experience: is my environment
ill-configured and/or did sidestep some obvious setup, or is the SAS
support known to be in need of some care?

The reason I ask is also because I went digging around the code, and
some things are hard for me to understand:

1.  "ess-sas-sh-command" is defined as the value for
"inferior-SAS-command" in the ess-SAS-pre-run-hook, but in my testing
(and for reasons I haven't yet fully explored) it doesn't seem to get to
SAS(), which will uses the "default" inferior-ess-process.

2. Assuming that "ess-sas-sh-command" is the way to go, SAS() currently
doesn't pass any arguments to (inferior-ess ...); this breaks the
ess-sas-sh-command script that expects the ptys for stdout and stderr.

3. The "ess-sas-goto*" family doesn't work as is, since from what I was
able to discover, it tries to go after a "test.log" and "test.lst" file
being visited, but AFAIK the *SAS.log* and *SAS.lst* buffers use the
redirection from the ess-sas-sh-command. These commands are used by
others, and specifically by ess-sas-graph-view.

Some other small things are also strange, e.g. the SAS keymap doesn't
seem to be activated (F12 is not assigned to ess-sas-graph-view, for
example).

I'm certainly missing lots of context here, so take the above as an
innocent attempt at trying to solve things.

The good news is that after "solving" the above (in a very quick and
dirty way), iESS with SAS works as I would expect:

* Interactive development works perfectly, with output going to the log
  and list buffers.
* I can use the graph view to open the last (ODS) plot created.

Additionally, I've started to experiment with the LSP server that SAS
built for the vscode extension, with encouraging results; this image
shows the completion-at-point behaviour:

https://i.imgur.com/HdpzCy7.png

I'm going to explore things a bit more, eventually get into polyline and
using something like Rmd/Rnw but with SAS (through SASmarkdown or
something else), but wanted to get the "base" environment stable first.


Best regards,

Frederico Muñoz



More information about the ESS-help mailing list