Discussion:
SAS language idiosyncrasies
(too old to reply)
j***@gmail.com
2007-05-08 20:47:00 UTC
Permalink
Bjarne Stroustrup once said that there are only two kinds of
programming languages:

* those people always bitch about and
* those nobody uses.

I searched SAS-L for any criticism of SAS and found almost none!
That's kind of strange since I know that SAS is widely used.

I have used SAS since it came out on the market in the early 70's. At
the time, I was delighted with the DATA step which saved me from
writing silly little FORTRAN programs to manipulate my data into the
form expected by BMDP. That DATA step is the main reason SAS blew all
its competitors out of the water. The rest, as the saying goes, is
history. Alas, when a product becomes dominant, it often endows its
developers with an undesirable arrogance and a tendancy to respond
"That's the way we do it!" to all suggestions for improvement.

I only realized the problem with SAS many years later when I studied
closely other programming languages:
SAS is probably among the worst widely used languages I
know of.

The bulk of the examples that I offer as evidence are better
formatted, hence
easier to read on my blog than they can be in this e-mail:

http://arrowmodel.com/cgi-bin/blosxom.cgi/jc/index.html#sas

. . .


I can go on like this for a while, but I think you get the idea.

The strange thing is that people who use SAS on a day to day basis
tend not to see how unnatural it is. It looks like the Sapir-Whorf
hypothesis in action.
( http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis )

But isn't it true that all the old languages have their quirks?

No! While it s true that Cobol and Basic will rot your brain because
of the paucity of their features, many old languages were either done
right from the start, or evolved into coherent ones: LISP, for
instance, SQL, C or R (an interesting alternative to SAS for doing
statistics). Together with more recent languages like Java, or Ruby,
they are much more consistent than SAS.
Barz, Ken
2007-05-08 21:19:26 UTC
Permalink
Hmm. I've never been one to hold my tongue on what I think are the
limitations of SAS. However, I think this is kind of on par with
throwing the proverbial baby out with the bathwater. (and might I
recommend a review of the proc sql documentation?)

SAS is a pretty old language that's carrying its legacy baggage along
with it. That said, I believe it's held up pretty well for itself.
(Who uses Fortran or Cobol for new development anymore? I use SAS every
day along with other/newer languages.)

And as far as being among the "worst" languages, I would much rather be
using SAS than, oh, APL, ADA, SPSS, even nasty old JavaScript.

I guess my main SAS gripes are that people like to force solutions in
SAS that would be more effective using something else (perhaps giving
them job security.) That and I never seem to get on anywhere that wants
to spend the money to really do SAS right. My kingdom for BI!



-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-***@LISTSERV.UGA.EDU] On Behalf Of
***@gmail.com
Sent: Tuesday, May 08, 2007 2:47 PM
To: SAS-***@LISTSERV.UGA.EDU
Subject: SAS language idiosyncrasies

Bjarne Stroustrup once said that there are only two kinds of
programming languages:

* those people always bitch about and
* those nobody uses.

I searched SAS-L for any criticism of SAS and found almost none!
That's kind of strange since I know that SAS is widely used.

I have used SAS since it came out on the market in the early 70's. At
the time, I was delighted with the DATA step which saved me from
writing silly little FORTRAN programs to manipulate my data into the
form expected by BMDP. That DATA step is the main reason SAS blew all
its competitors out of the water. The rest, as the saying goes, is
history. Alas, when a product becomes dominant, it often endows its
developers with an undesirable arrogance and a tendancy to respond
"That's the way we do it!" to all suggestions for improvement.

I only realized the problem with SAS many years later when I studied
closely other programming languages:
SAS is probably among the worst widely used languages I
know of.

The bulk of the examples that I offer as evidence are better
formatted, hence
easier to read on my blog than they can be in this e-mail:

http://arrowmodel.com/cgi-bin/blosxom.cgi/jc/index.html#sas

. . .


I can go on like this for a while, but I think you get the idea.

The strange thing is that people who use SAS on a day to day basis
tend not to see how unnatural it is. It looks like the Sapir-Whorf
hypothesis in action.
( http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis )

But isn't it true that all the old languages have their quirks?

No! While it s true that Cobol and Basic will rot your brain because
of the paucity of their features, many old languages were either done
right from the start, or evolved into coherent ones: LISP, for
instance, SQL, C or R (an interesting alternative to SAS for doing
statistics). Together with more recent languages like Java, or Ruby,
they are much more consistent than SAS.
toby dunn
2007-05-08 21:58:37 UTC
Permalink
Hmmm SAS has plenty of problems and we often yell about them even on th
elist, you need to do your search better.


From yoru web page:
There are two ways to write comments in SAS:

/* C-like */* and Fortran-like (with trailing semicolon);

Neither of those can be nested. To comment out a block of code, one needs to
resort to the following trick:

%macro skip;
Stuff here is not executed
%mend skip;Why?

Well you missed one commenting type which is limited to with in a %Macro
which is the %* comment.

I would yo ulike the comments to work? Seems to me they work perfectly fine
the way they are.






2.) "There's a concept of NULL (missing value) in SAS" There is? Well now
would you like to show us an example of a Null value in a data set. As far
as I know if we limit ourselves to the Data Set a value is either missing or
has a value.


3.) "The notion of naming convention seems to elude SAS language designers.
Compare Proc import and Proc export: "
I wont copy all the code.... well lets see one imports a file and exports a
data set. So if you wanted to make any changes I would suggest:

proc import
File='/somewhere/myfile.csv'
Out=mydataset
dbms=csv;
run;

proc export
Data=mydataset
Out='/somewhere/myfile.csv'
dbms=csv;
run;



The rest of the Proc Import rant is well just stupid in my eyes as I hate
both and well only use them if and only if I am moding someone elses code,
just for the sake of fluidity in the program.



5.) Arbitrary limits are everywhere. You create a string variable and by
default its length is limited to 8. You assign something to it and it gets
silently truncated.

Well how long it is depends on how loose you want to make your code. SAS
allows you do do a lot of things whether or not you do so intelligently or
stupidly is well up to you. You have to live with the consequences.



6.) Proc sql is just like SQL, but not always.
GROUP BY a variable works as expected.
But can you guess what GROUP BY any expression does?

NO I repeat NO 2 languages have the same implementation of SQL.... so get
the hell over it already.


7.) Error messages and I would add Warnings.... yeah I agree here they could
use some improvement in this area.

see there I did agree with one thing you said.


8.) Proc sql again. Guess what will be the name of the second variable in
the new_table:

proc sql;
CREATE TABLE new_table AS
SELECT foo, COUNT(*) "cnt"
FROM old_table
GROUP BY foo;
quit;


Hmmm should SAS read your mind also.... look you dont give it a Key word AS
and then a unquoted hunk of text to use as a name well it does what it has
to do so the code will run correctly well as close as it can to correct
since You the Programmer screwed up. What I did find funny is that it does
use the quoted string as the label. That should at the very least generate
a warning or error.




Now if you want to beat the hell out of SAS do it on the correct level like
on its really really crappy reporting ability.... Now your talking.





Toby Dunn

You can see a lot by just looking. ~Yogi Berra

Do not seek to follow in the footsteps of the wise. Seek what they sought.
~Matsuo Basho

You never know what is enough, until you know what is more than enough.
~William Blake, Proverbs of Hell





From: "***@gmail.com" <***@GMAIL.COM>
Reply-To: "***@gmail.com" <***@GMAIL.COM>
To: SAS-***@LISTSERV.UGA.EDU
Subject: SAS language idiosyncrasies
Date: Tue, 8 May 2007 13:47:00 -0700

Bjarne Stroustrup once said that there are only two kinds of
programming languages:

* those people always bitch about and
* those nobody uses.

I searched SAS-L for any criticism of SAS and found almost none!
That's kind of strange since I know that SAS is widely used.

I have used SAS since it came out on the market in the early 70's. At
the time, I was delighted with the DATA step which saved me from
writing silly little FORTRAN programs to manipulate my data into the
form expected by BMDP. That DATA step is the main reason SAS blew all
its competitors out of the water. The rest, as the saying goes, is
history. Alas, when a product becomes dominant, it often endows its
developers with an undesirable arrogance and a tendancy to respond
"That's the way we do it!" to all suggestions for improvement.

I only realized the problem with SAS many years later when I studied
closely other programming languages:
SAS is probably among the worst widely used languages I
know of.

The bulk of the examples that I offer as evidence are better
formatted, hence
easier to read on my blog than they can be in this e-mail:

http://arrowmodel.com/cgi-bin/blosxom.cgi/jc/index.html#sas

.. . .


I can go on like this for a while, but I think you get the idea.

The strange thing is that people who use SAS on a day to day basis
tend not to see how unnatural it is. It looks like the Sapir-Whorf
hypothesis in action.
( http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis )

But isn't it true that all the old languages have their quirks?

No! While it s true that Cobol and Basic will rot your brain because
of the paucity of their features, many old languages were either done
right from the start, or evolved into coherent ones: LISP, for
instance, SQL, C or R (an interesting alternative to SAS for doing
statistics). Together with more recent languages like Java, or Ruby,
they are much more consistent than SAS.

_________________________________________________________________
Now you can see trouble…before he arrives
http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_protection_0507
Alan Churchill
2007-05-08 23:25:13 UTC
Permalink
Toby,

A couple of items.

In C#, we can nest comments:

//Comment
//// Sub-Comment
////// Sub- sub comment

This is very, very useful. We can also code things so that code gets
included/excluded depending on whether we are in debug or release mode.
There are a number of nifty features like that.

Also, if the comments are done right, we get auto-documentation of the code:

/// <summary>
/// This runs specific SAS statements
/// </summary>
/// <returns>The SAS log</returns>
/// <param name="statements">The SAS stements to be
submitted</param>

I already built the ability to do that for SAS code. It can be found on my
website:

http://utilities.savian.net

I don't like SAS chopping strings. I wish we could get better indications of
when it occurs.

On the SQL thing, LINQ promises to provide a lot of sanity in this area. I
wouldn't be surprised to see long-term adoption of LINQ by a number of
players but we'll have to wait and see.

Alan

Alan Churchill
Savian "Bridging SAS and Microsoft Technologies"
www.savian.net



-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-***@LISTSERV.UGA.EDU] On Behalf Of toby
dunn
Sent: Tuesday, May 08, 2007 3:59 PM
To: SAS-***@LISTSERV.UGA.EDU
Subject: Re: SAS language idiosyncrasies

Hmmm SAS has plenty of problems and we often yell about them even on th
elist, you need to do your search better.


From yoru web page:
There are two ways to write comments in SAS:

/* C-like */* and Fortran-like (with trailing semicolon);

Neither of those can be nested. To comment out a block of code, one needs to
resort to the following trick:

%macro skip;
Stuff here is not executed
%mend skip;Why?

Well you missed one commenting type which is limited to with in a %Macro
which is the %* comment.

I would yo ulike the comments to work? Seems to me they work perfectly fine
the way they are.






2.) "There's a concept of NULL (missing value) in SAS" There is? Well now
would you like to show us an example of a Null value in a data set. As far
as I know if we limit ourselves to the Data Set a value is either missing or
has a value.


3.) "The notion of naming convention seems to elude SAS language designers.
Compare Proc import and Proc export: "
I wont copy all the code.... well lets see one imports a file and exports a
data set. So if you wanted to make any changes I would suggest:

proc import
File='/somewhere/myfile.csv'
Out=mydataset
dbms=csv;
run;

proc export
Data=mydataset
Out='/somewhere/myfile.csv'
dbms=csv;
run;



The rest of the Proc Import rant is well just stupid in my eyes as I hate
both and well only use them if and only if I am moding someone elses code,
just for the sake of fluidity in the program.



5.) Arbitrary limits are everywhere. You create a string variable and by
default its length is limited to 8. You assign something to it and it gets
silently truncated.

Well how long it is depends on how loose you want to make your code. SAS
allows you do do a lot of things whether or not you do so intelligently or
stupidly is well up to you. You have to live with the consequences.



6.) Proc sql is just like SQL, but not always.
GROUP BY a variable works as expected.
But can you guess what GROUP BY any expression does?

NO I repeat NO 2 languages have the same implementation of SQL.... so get
the hell over it already.


7.) Error messages and I would add Warnings.... yeah I agree here they could
use some improvement in this area.

see there I did agree with one thing you said.


8.) Proc sql again. Guess what will be the name of the second variable in
the new_table:

proc sql;
CREATE TABLE new_table AS
SELECT foo, COUNT(*) "cnt"
FROM old_table
GROUP BY foo;
quit;


Hmmm should SAS read your mind also.... look you dont give it a Key word AS
and then a unquoted hunk of text to use as a name well it does what it has
to do so the code will run correctly well as close as it can to correct
since You the Programmer screwed up. What I did find funny is that it does
use the quoted string as the label. That should at the very least generate
a warning or error.




Now if you want to beat the hell out of SAS do it on the correct level like
on its really really crappy reporting ability.... Now your talking.





Toby Dunn

You can see a lot by just looking. ~Yogi Berra

Do not seek to follow in the footsteps of the wise. Seek what they sought.
~Matsuo Basho

You never know what is enough, until you know what is more than enough.
~William Blake, Proverbs of Hell





From: "***@gmail.com" <***@GMAIL.COM>
Reply-To: "***@gmail.com" <***@GMAIL.COM>
To: SAS-***@LISTSERV.UGA.EDU
Subject: SAS language idiosyncrasies
Date: Tue, 8 May 2007 13:47:00 -0700

Bjarne Stroustrup once said that there are only two kinds of
programming languages:

* those people always bitch about and
* those nobody uses.

I searched SAS-L for any criticism of SAS and found almost none!
That's kind of strange since I know that SAS is widely used.

I have used SAS since it came out on the market in the early 70's. At
the time, I was delighted with the DATA step which saved me from
writing silly little FORTRAN programs to manipulate my data into the
form expected by BMDP. That DATA step is the main reason SAS blew all
its competitors out of the water. The rest, as the saying goes, is
history. Alas, when a product becomes dominant, it often endows its
developers with an undesirable arrogance and a tendancy to respond
"That's the way we do it!" to all suggestions for improvement.

I only realized the problem with SAS many years later when I studied
closely other programming languages:
SAS is probably among the worst widely used languages I
know of.

The bulk of the examples that I offer as evidence are better
formatted, hence
easier to read on my blog than they can be in this e-mail:

http://arrowmodel.com/cgi-bin/blosxom.cgi/jc/index.html#sas

.. . .


I can go on like this for a while, but I think you get the idea.

The strange thing is that people who use SAS on a day to day basis
tend not to see how unnatural it is. It looks like the Sapir-Whorf
hypothesis in action.
( http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis )

But isn't it true that all the old languages have their quirks?

No! While it s true that Cobol and Basic will rot your brain because
of the paucity of their features, many old languages were either done
right from the start, or evolved into coherent ones: LISP, for
instance, SQL, C or R (an interesting alternative to SAS for doing
statistics). Together with more recent languages like Java, or Ruby,
they are much more consistent than SAS.

_________________________________________________________________
Now you can see trouble…before he arrives
http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_protection_0507
Peter Flom
2007-05-09 00:30:58 UTC
Permalink
I don't know much about programming, but two things:
1) Sure SAS has idiosyncrasies. You mention R. R has more (IMO) - after all, it was written by hundreds or even thousands of people. SAS has TONS of stuff that R doesn't....like variable lists.

2) You mention histograms. Actually, histograms are not a very good graphic. I don't have my Cleveland book in front of me but he said something like:

"Longevity and ubiquity are not signs of utility" when discussing histograms.

Peter
Ian Whitlock
2007-05-09 02:18:02 UTC
Permalink
Summary: SAS programmers are even more idosyncratic
#iw-value

jchetrit,

Your basic complaint about SAS consistency seems to be that it
is not consistent with other languages. That is not a very
consistent complaint. Let's look at an example from your site

http://arrowmodel.com/cgi-bin/blosxom.cgi/jc/index.html#sas

which mentions:

There's a concept of NULL (missing value) in SAS, but it is
not universally applied. For example, a logical operation
between a missing value and anything else results in a missing
value, which is perfectly logical. But if you compare a
missing value to a numeric variable — surprise — the result is
NOT a missing value.

Got that? In a comparison with a number, a missing value is
treated as if it is, of all things, minus infinity. Why?

SAS uses a binary logic, hence all comparisons are true or false.
The basic point here is that it follows by consistency from a
reasonable decision.

Personally I would find having the comparison

. < 0

neither true nor false rather confusing. Note I did not say
inconsistent. The fact that you have worked with SAS for over
30 years and still think having the comparison true to be
inconsistent makes one wonder ...

Now would you rather have

. < 0

be false instead or true? Why?

You also say

I searched SAS-L for any criticism of SAS and found almost
none! That's kind of strange since I know that SAS is widely
used.

This is more a comment about your ability to search SAS-L than it
is about the numerous complaints that various people including
myself have offered on SAS-L from time to time. Usually they
involve things like <> meaning one thing in one kind of SAS
statement and another in another kind of SAS statement. Now that
is a kind of inconsistency, albeit one that entered the language
by adopting SQL and trying to maintain consistency with both SAS
and SQL. I think this discussion took place in the last month or
two.

Most of SAS inconsistencies come from comparing two procedures.
Yes it would be nice if these inconsistencies didn't exist, but
if changed now they would be inconsistent with the prior version
of the language. Which for of inconsistency is worse?

Ian Whitlock
David L Cassell
2007-05-09 06:02:07 UTC
Permalink
Post by j***@gmail.com
Bjarne Stroustrup once said that there are only two kinds of
* those people always bitch about and
* those nobody uses.
Well, Larry Wall said "The utility of a programmg language is inversely
proportional to the number of axes the designer has to grind."
Post by j***@gmail.com
I searched SAS-L for any criticism of SAS and found almost none!
That's kind of strange since I know that SAS is widely used.
That's because you did a poor job of searching. We kvetch about
the language and its deficiencies and its future and its extensions
pretty much daily.
Post by j***@gmail.com
I have used SAS since it came out on the market in the early 70's. At
the time, I was delighted with the DATA step which saved me from
writing silly little FORTRAN programs to manipulate my data into the
form expected by BMDP. That DATA step is the main reason SAS blew all
its competitors out of the water. The rest, as the saying goes, is
history. Alas, when a product becomes dominant, it often endows its
developers with an undesirable arrogance and a tendancy to respond
"That's the way we do it!" to all suggestions for improvement.
And also, you get into the C/C++ mode of "we cannot break existing
code or paradigms, we can only bolt new pieces onto the existing
framework".
Post by j***@gmail.com
I only realized the problem with SAS many years later when I studied
SAS is probably among the worst widely used languages I
know of.
Ada? APL? Basic? JavaScript? Forth? Postscript?
(I'm not even going to take the easy shots of Fortran, Algol, etc.)

I do *NOT* think that SAS is perfect, or even 'better than X in all
possible cases', but I find your argument weak.
Post by j***@gmail.com
The bulk of the examples that I offer as evidence are better
formatted, hence
http://arrowmodel.com/cgi-bin/blosxom.cgi/jc/index.html#sas
. . .
I can't believe you have problems with the SAS missing values. SQL
has a lame NULL approach, and other languages simply don't deal
well with this. If they deal with it at all! But SAS is a database
and statistics system, and as such needs to deal effectively with
lots of *different* types of missings in the same database. It is
the only language that does this in a well-structured, flexible manner.

And I can't believe you are going to claim that SAS cannot be
run from the unix command line. I've been doing it for nearly two
decades. Sure, PROC IMPORT and PROC EXPORT are major lamers.
So are some of the Microsoft Foundation Classes for C++ . No
language has perfect feature sets. But SAS works fine on unix.
If you had searched on this topic in SAS-L, you would have found lots
of complaints about these procs, lots of discussions on their shortfalls,
and even occasional stuff about the need for _noterminal in some
settings.
Post by j***@gmail.com
I can go on like this for a while, but I think you get the idea.
The strange thing is that people who use SAS on a day to day basis
tend not to see how unnatural it is. It looks like the Sapir-Whorf
hypothesis in action.
( http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis )
I'll disagree strongly. This forum routinely thrashes out points
like this.
Post by j***@gmail.com
But isn't it true that all the old languages have their quirks?
No! While it s true that Cobol and Basic will rot your brain because
of the paucity of their features, many old languages were either done
right from the start, or evolved into coherent ones: LISP, for
instance, SQL, C or R (an interesting alternative to SAS for doing
statistics). Together with more recent languages like Java, or Ruby,
they are much more consistent than SAS.
I'll disagree here too. R is *definitely* not an 'old language' that fits
this model. It was built based on the S programming model. And it
has not evolved into a coherent unity: it has fragmented because a
lot of the modules have their own mini-languages as per the quirks of
the authors.

SQL has not evolved into a coherent whole either. Not anyone's
version of SQL has. Hopefully, future variants like LINQ will solve
some of the issues. But no one's version of SQL runs just like anyone
elses, and insisting that SAS PROC SQL run like a different SQL is
as silly as asking Oracle to change *their* version of SQL to match,
say, that of Microsoft.

C was not 'done right from the start' because the start was BCPL,
which was flawed.

And consistency is the hobgoblin of little minds, if you don't mind
another quote. Look at Perl. It has done the same thing as SAS:
it has combined features from multiple languages, and ignored those
who complained about its inconsistencies. SAS has SQL and PL/1
features which in essence conflict, which leads to some of the
problems we discuss here. Similarly, Perl wedged operators from C
and awk and sed together when that naturally leads to some serious
confusion for the neophyte. Both are adding functionality in a
way that makes sense for an outside language.


After al lthat, let me reimnd you that SAS is not a 2GL or a 3GL or
an OOP language. It was designed from the beginning to be a 4GL,
with the systemata that this implies. So you should not expect
rigid consistency across all components.

HTCT,
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330

_________________________________________________________________
Now you can see trouble…before he arrives
http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_protection_0507
c***@yahoo.com
2007-05-09 08:20:58 UTC
Permalink
Maybe the reason there's so little bitching is that SAS does pretty
well -- compared to other statistical packages. I've been using SAS
since 1985 but I've also used SPSS, Stata and R. Stata is better than
SAS in many ways, it's more consistent, statistical results are
available as macro variables or matrices without recourse to ods or
anything like that, macros can be programmed using the same syntax as
builtin commands and can be documented with help files like builtin
commands. But there's plenty to bitch about Stata too and SAS is a
good second. R on the other hand really made me appreciate SAS. R is
fine as long as you're dealing with numbers but converting between a
string and a variable is horribly confusing, dealing with strings at
all is a disaster.

But if it's bitching you want ...

WHERE'S MY RECODE COMMAND?
(see SPSS, Stata, R for examples)

WHERE'S MY RESHAPE COMMAND?
(Proc transpose doesn't cut it, see Stata, R for examples on how to do
it right).

WHY CAN'T I DO REGEX SEARCH/REPLACE IN THE ADVANCED EDITOR?
(Sigh)

Why can't SAS CLOSE (work) DATASETS OPENED IN EXPLORER BEFORE
EXECUTING?

Enough shouting. There's plenty more to bitch about but I've got work
to do.

Best,
John Hendrickx
Post by j***@gmail.com
Bjarne Stroustrup once said that there are only two kinds of
* those people always bitch about and
* those nobody uses.
I searched SAS-L for any criticism of SAS and found almost none!
That's kind of strange since I know that SAS is widely used.
I have used SAS since it came out on the market in the early 70's. At
the time, I was delighted with the DATA step which saved me from
writing silly little FORTRAN programs to manipulate my data into the
form expected by BMDP. That DATA step is the main reason SAS blew all
its competitors out of the water. The rest, as the saying goes, is
history. Alas, when a product becomes dominant, it often endows its
developers with an undesirable arrogance and a tendancy to respond
"That's the way we do it!" to all suggestions for improvement.
I only realized the problem with SAS many years later when I studied
SAS is probably among the worst widely used languages I
know of.
The bulk of the examples that I offer as evidence are better
formatted, hence
http://arrowmodel.com/cgi-bin/blosxom.cgi/jc/index.html#sas
. . .
I can go on like this for a while, but I think you get the idea.
The strange thing is that people who use SAS on a day to day basis
tend not to see how unnatural it is. It looks like the Sapir-Whorf
hypothesis in action.
(http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis)
But isn't it true that all the old languages have their quirks?
No! While it s true that Cobol and Basic will rot your brain because
of the paucity of their features, many old languages were either done
right from the start, or evolved into coherent ones: LISP, for
instance, SQL, C or R (an interesting alternative to SAS for doing
statistics). Together with more recent languages like Java, or Ruby,
they are much more consistent than SAS.
Peter Flom
2007-05-09 10:30:13 UTC
Permalink
Post by David L Cassell
That's because you did a poor job of searching. We kvetch about
the language and its deficiencies and its future and its extensions
pretty much daily.
You mean YOU didn't have to pledge to worship at the altar of SAS ?
And they let you post here?

:-) :-)
Post by David L Cassell
I'll disagree here too. R is *definitely* not an 'old language' that fits
this model. It was built based on the S programming model. And it
has not evolved into a coherent unity: it has fragmented because a
lot of the modules have their own mini-languages as per the quirks of
the authors.
Further, to me, any language that requires the level of parentheses nesting that R sometimes requires can lay little claim to being natural.

I've used R and SAS quite a bit.

R beats SAS for graphics, and R beats SAS for having cutting-edge statistics. also R is free.

SAS beats R for data handling, documentation, consistency, ease, tech-support.


Peter
Mike Rhoads
2007-05-09 12:39:34 UTC
Permalink
Let me also add that over the years I have interacted with quite a few
SAS developers, without seeing any of the "arrogance" that is alluded to
here. On the contrary, I have found them to be both enthusiastic about
their work and more than willing to listen to user feedback and
suggestions.

Mike Rhoads
Westat
***@Westat.com

-----Original Message-----
From: owner-sas-***@listserv.uga.edu [mailto:owner-sas-***@listserv.uga.edu]
On Behalf Of David L Cassell
Sent: Wednesday, May 09, 2007 2:02 AM
To: SAS-***@LISTSERV.UGA.EDU
Subject: RE: SAS language idiosyncrasies


***@GMAIL.COM wrote:

...
Post by j***@gmail.com
I have used SAS since it came out on the market in the early 70's. At
the time, I was delighted with the DATA step which saved me from
writing silly little FORTRAN programs to manipulate my data into the
form expected by BMDP. That DATA step is the main reason SAS blew all
its competitors out of the water. The rest, as the saying goes, is
history. Alas, when a product becomes dominant, it often endows its
developers with an undesirable arrogance and a tendancy to respond
"That's the way we do it!" to all suggestions for improvement.
And also, you get into the C/C++ mode of "we cannot break existing
code or paradigms, we can only bolt new pieces onto the existing
framework".

...

HTCT,
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330

_________________________________________________________________
Now you can see trouble...before he arrives
http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_protection_
0507
Sigurd Hermansen
2007-05-09 14:03:05 UTC
Permalink
Arbitrary limits are everywhere. You create a string variable and by =
default its length is limited to 8. You assign something to it and it =
gets silently truncated. You import a file and the line length is =
limited to 256. Of course you can change it by using the lrecl=3D =
option, but why can't SAS do it?=20
________________________________

How would one create a string variable that has a default length? =
Working from memory I can't recall seeing a default assignment of a =
character variable length, such as the eight-byte default for numeric =
variables. Setting the 'first instance' length when an INPUT process =
doesn't have the length specified may cause problems, but I wouldn't =
call it 'arbitrary'. The same goes for a default line length in a file =
import.
Proc sql is just like SQL, but not always.=20
... neither is any other implementation of SQL exactly like an ANSI SQL =
standard, or any other flavor of SQL.
GROUP BY a variable works as expected.=20
But can you guess what GROUP BY any expression does?=20

Nothing!!!=20

I'd have to see an example of this quirk. SAS allows more flexibility in =
GROUP operations than other SQL dialects.

________________________________
Error messages are not always helpful in identifying the problem. If =
logistic regression fails to provide any output except for cryptic=20
"Error: There are no valid observations",=20
what exactly does it mean? Why not just say=20
"Warning: all values of variable FOO are missing"
exclude it from the list of predictors, and go on?=20
=20
... perhaps because other patterns of missing values could make all obs =
invalid and SAS/Stat would be changing the specification of the model. I =
can't think of a situation where an analyst would prefer to see a model =
reduced automatically.

________________________________
Proc sql again. Guess what will be the name of the second variable in =
the new_table:=20

proc sql;
CREATE TABLE new_table AS
SELECT foo,=20
COUNT(*) "cnt"
FROM old_table
GROUP BY foo;
quit;

Of course it's _TEMA001, because cnt is the label, not the variable =
name. Bizarre, but you can make it work with


proc sql;
CREATE TABLE new_table AS=20
(SELECT * FROM=20
(SELECT foo,=20
COUNT(*)
FROM old_table
GROUP BY foo
) x ( foo, cnt )
);
quit;
________________________________

The query is creating a SAS dataset in which column variables have =
specific properties, such as variable labels. Again, each flavor of SQL =
has variations in syntax.
=20
You can see more telling critiques of the SAS System in the SAS-L =
Archives. I'd say that SAS is evolving at a rate consistent with a =
programming environment of its scope and depth.
S

=20

=20
=20

________________________________

From: owner-sas-***@listserv.uga.edu on behalf of toby dunn
Sent: Tue 5/8/2007 5:58 PM
To: ***@GMAIL.COM; SAS-***@LISTSERV.UGA.EDU
Subject: RE: SAS language idiosyncrasies



Hmmm SAS has plenty of problems and we often yell about them even on th
elist, you need to do your search better.


From yoru web page:
There are two ways to write comments in SAS:

/* C-like */* and Fortran-like (with trailing semicolon);

Neither of those can be nested. To comment out a block of code, one =
needs to
resort to the following trick:

%macro skip;
Stuff here is not executed
%mend skip;Why?

Well you missed one commenting type which is limited to with in a %Macro
which is the %* comment.

I would yo ulike the comments to work? Seems to me they work perfectly =
fine
the way they are.






2.) "There's a concept of NULL (missing value) in SAS" There is? Well =
now
would you like to show us an example of a Null value in a data set. As =
far
as I know if we limit ourselves to the Data Set a value is either =
missing or
has a value.


3.) "The notion of naming convention seems to elude SAS language =
designers.
Compare Proc import and Proc export: "
I wont copy all the code.... well lets see one imports a file and =
exports a
data set. So if you wanted to make any changes I would suggest:

proc import
File=3D'/somewhere/myfile.csv'
Out=3Dmydataset
dbms=3Dcsv;
run;

proc export
Data=3Dmydataset
Out=3D'/somewhere/myfile.csv'
dbms=3Dcsv;
run;



The rest of the Proc Import rant is well just stupid in my eyes as I =
hate
both and well only use them if and only if I am moding someone elses =
code,
just for the sake of fluidity in the program.



5.) Arbitrary limits are everywhere. You create a string variable and by
default its length is limited to 8. You assign something to it and it =
gets
silently truncated.

Well how long it is depends on how loose you want to make your code. =
SAS
allows you do do a lot of things whether or not you do so intelligently =
or
stupidly is well up to you. You have to live with the consequences.



6.) Proc sql is just like SQL, but not always.
GROUP BY a variable works as expected.
But can you guess what GROUP BY any expression does?

NO I repeat NO 2 languages have the same implementation of SQL.... so =
get
the hell over it already.


7.) Error messages and I would add Warnings.... yeah I agree here they =
could
use some improvement in this area.

see there I did agree with one thing you said.


8.) Proc sql again. Guess what will be the name of the second variable =
in
the new_table:

proc sql;
CREATE TABLE new_table AS
SELECT foo, COUNT(*) "cnt"
FROM old_table
GROUP BY foo;
quit;


Hmmm should SAS read your mind also.... look you dont give it a Key word =
AS
and then a unquoted hunk of text to use as a name well it does what it =
has
to do so the code will run correctly well as close as it can to correct
since You the Programmer screwed up. What I did find funny is that it =
does
use the quoted string as the label. That should at the very least =
generate
a warning or error.




Now if you want to beat the hell out of SAS do it on the correct level =
like
on its really really crappy reporting ability.... Now your talking.





Toby Dunn

You can see a lot by just looking. ~Yogi Berra

Do not seek to follow in the footsteps of the wise. Seek what they =
sought.
~Matsuo Basho

You never know what is enough, until you know what is more than enough.
~William Blake, Proverbs of Hell





From: "***@gmail.com" <***@GMAIL.COM>
Reply-To: "***@gmail.com" <***@GMAIL.COM>
To: SAS-***@LISTSERV.UGA.EDU
Subject: SAS language idiosyncrasies
Date: Tue, 8 May 2007 13:47:00 -0700

Bjarne Stroustrup once said that there are only two kinds of
programming languages:

* those people always bitch about and
* those nobody uses.

I searched SAS-L for any criticism of SAS and found almost none!
That's kind of strange since I know that SAS is widely used.

I have used SAS since it came out on the market in the early 70's. At
the time, I was delighted with the DATA step which saved me from
writing silly little FORTRAN programs to manipulate my data into the
form expected by BMDP. That DATA step is the main reason SAS blew all
its competitors out of the water. The rest, as the saying goes, is
history. Alas, when a product becomes dominant, it often endows its
developers with an undesirable arrogance and a tendancy to respond
"That's the way we do it!" to all suggestions for improvement.

I only realized the problem with SAS many years later when I studied
closely other programming languages:
SAS is probably among the worst widely used languages I
know of.

The bulk of the examples that I offer as evidence are better
formatted, hence
easier to read on my blog than they can be in this e-mail:

http://arrowmodel.com/cgi-bin/blosxom.cgi/jc/index.html#sas

.. . .


I can go on like this for a while, but I think you get the idea.

The strange thing is that people who use SAS on a day to day basis
tend not to see how unnatural it is. It looks like the Sapir-Whorf
hypothesis in action.
( http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis )

But isn't it true that all the old languages have their quirks?

No! While it s true that Cobol and Basic will rot your brain because
of the paucity of their features, many old languages were either done
right from the start, or evolved into coherent ones: LISP, for
instance, SQL, C or R (an interesting alternative to SAS for doing
statistics). Together with more recent languages like Java, or Ruby,
they are much more consistent than SAS.

_________________________________________________________________
Now you can see trouble...before he arrives
http://newlivehotmail.com/?ocid=3DTXT_TAGHM_migration_HM_viral_protection=
_0507
Matt Pettis
2007-05-09 18:41:17 UTC
Permalink
I'll add this...

I have to do extensive programming in SAS and Perl, and for some reason, I
care more when things are inelegant in Perl than in SAS. I only really care
about SAS when I can't solve a problem that should be in the data-processing
domain, and not that it has some idiosyncratic syntax for solving it.

I have come to expect to do easy look-ahead regular-expression text parsing
in Perl, and am just happy that it even exists in SAS for the few times I
use it there.

I think that, if there is a perceived lack of carping about SAS, it's
because it does so well in its problem domain. I don't expect to write a
C-compiler in SAS, but I expect easy syntax for parsing a rectangular flat
file. I know that a missing numerical value is equivalent to negative
infinity, and it doesn't disrupt my thought process in coding -- I account
for that naturally now.

Can things be made better in the SAS language? Sure, everybody here agrees.
But I get done what I need to quite well, and for a statistical and
reporting language, that's the extent of my expectations.

Matt

Continue reading on narkive:
Loading...