Skip to content
Prev 171947 / 398503 Next

Inefficiency of SAS Programming

2009/2/27 Peter Dalgaard <p.dalgaard at biostat.ku.dk>:
I'm not sure which is easier to grasp. When I first saw the original
version I thought it was an odd way of doing "SUB_N = &N.". Only then
did I have a closer look and spot the missing 2, 5, and 16. A comment
would have been very enlightening. But there was nothing relevant.
I think the important thing with any programming is to make sure what
you want is expressed in words somewhere. If not in the code, then in
the comments. And operations like this should be abstracted into
functions.

  All the examples of SAS code I've seen seem to fall into the old
practices of writing great long 'scripts', with minimal code-reuse and
encapsulation of useful functionality. If these SAS scripts are then
given to new SAS programmers then the chances are they will follow
these bad practices. Show them well-written R code (or C, or Python)
and maybe they can implement those good practices into their SAS work.
Assuming SAS can do that. I'm not sure.


Barry