Any SAS users (beside me) in this forum?

  • Thread starter Thread starter DrDu
  • Start date Start date
  • Tags Tags
    Forum
AI Thread Summary
The discussion centers around the use of SAS (Statistical Analysis System) for statistical analysis, particularly in the context of bio sciences and finance. Users express frustration with SAS's outdated interface and limited editing capabilities, especially when using it on Linux. They share experiences with alternative text editors like vim, Gedit, and Geany to enhance coding efficiency, noting features like color-coding and regex support. There is a consensus that SAS's macro language is complex and unintuitive, stemming from its origins in the 1970s, which contributes to its perception as old-fashioned. Participants also discuss workarounds for submitting code from external editors to SAS, highlighting the challenges posed by the software's design and environment limitations. Overall, the conversation reflects a blend of practical tips and shared grievances about SAS's usability in modern data analysis workflows.
DrDu
Science Advisor
Messages
6,405
Reaction score
1,002
I am using SAS (sweat and suffer) for many years now on a daily basis in work and it would be nice to be able to exchange here some problems. However, searching for "SAS" in physics forums only turns up tons of post related to science advisors (SAs).
 
Technology news on Phys.org
My main tool for statistical analysis is R, but I use SAS sometimes, because there are some protected data sets that can only be accessed through a SAS engine. I don't know if my little knowledge would be any use but if I see any new threads with SAS in the title I'd probably have a look and comment if I thought I could say anything useful, because I do need to keep my knowledge levels up.

Is your work in the bio sciences? My impression is that SAS has a very strong presence in that field, and much less so in physics. I come across it fairly often in my own field of finance, too - about 50/50 with R (and, very lamentably, Excel :eek:).
 
Yes, I work AS an epidemiologist.
 
Me, for my sins. Happy to discuss it - as long as you don't mind the occasional rant about how much I dislike it...
 
I don't know whether I ever met anyone who really liked SAS :-)
I am using SAS now under Linux and I am especially pissed off the stone age style integrated environment (not that I would be more fond having to work under Windows). I am trying now to use some other editor (vim in my case) with SAS. There exist EDITCMD and HOSTEDIT commands, but I didn't find much about its use on the internet. I also tried to copy code to some jointly used buffer and submit it from there, but I didn't figure this out yet.
 
@DrDu: My use of SAS is mostly under Linux too. I use UniversitySAS (because we don't have to pay for it) running in an Oracle VirtualBox virtual machine. The edit capability is very limited, although one thing I like about SAS is the pretty colour-coding. Whenever I have to do more complicated code editing I copy the code across to a text editor, make the changes, then copy it back to the SAS window (which is in a browser). Gedit has the advantage that it recognizes SAS code if you save the files as something.sas, and then does some colour-coding and bracket matching to help. Gedit doesn't have regular expression capability though, so I switch to Geany when I need to do that. One day I mean to re-learn emacs, which I suspect may be able to do both of those.

I think the reason SAS seems so old-fashioned is that it is AFAIK the oldest statistical processing language, and was developed in the seventies. So to me it looks a bit like FORTRAN. Even FORTRAN doesn't put a statement terminator after a DO though - I'm still coming to terms with the idea of:

DO;
something;
END;

The macro language seems so much more complicated and unintuitive than what's in other languages too. But I suppose one gets used to it and then doesn't notice any more.
 
Yes, emacs and vom also habe colouring schemes for SAS code.
 
I've got SAS on Windows, and am stuck with the built in editor because the system is so locked down. Actually, the Advanced Editor is one of the least dislikable parts of SAS. Its "keyboard macros" let you write a lot of standard stuff with a few keystrokes, and it's actually got regex search and replace.

I think the basic problem with SAS is that its original authors didn't quite have the vision to see what they wanted to do, and kept growing the system to plaster over shortcomings rather than rebuild. That's the macro language through and through - it's a patch to allow you to do things like process a bunch of data sets in the same way, but it's a layer on top of the data processing language and the interface between the two is quite clunky.

Personal opinion, obviously. But that's what it looks lik to me.
 
I agree with you on SAS problems.
Under Unix, there is no enhanced editor. What I did now was to set key F3 in SAS to "submit buffer=xclipbrd" so that I can submit simply the copied part from my text editor. Clearly it would be even nicer if I could define some key within the editor to pass the "submit" command to SAS. I tried something
like "echo tput (kf3) > /usr/proc/123/fg/0" but this didn't work.
 
  • #10
No enhanced editor would be a problem.

I can't think of a workaround to let you submit from your editor. The best I can think of is to do something like invoke SAS using -stdio and feeding its stdin from your editor and capturing its stdout and stderr somehow. Then start a second instance of SAS so that you can use the Explorer. Not sure how you'd handle the results window though, even assuming this works at all.
 
  • #11
I found a way to pass a command to the SAS Editor: with "wmctrl -l" I get a list of all open xwindows and their ID's.
With "xdotool key --window <ID> F3" I can pass e.g. the F3 key to that program.
This can be combined into
xdotool key --window $(wmctrl -l | grep "SAS: Program Editor" | awk '{print $1}') F3
which can be mapped to a key of the editor.
 
Last edited:
  • Like
Likes Ibix
Back
Top