Q: Name range list SAS doc errors

Hi friends,

Name range lists u/i SAS 8 have the form: FirstVar -- LastVar, and so says
the SAS 8 online doc.
The SAS 9 online doc says the form is: FirstVar - LastVar (one dash), while
the (downloadable) SAS manual (base_lrconcept_8943.pdf) says it is:
FirstVar --- LastVar (three dashes).

I would say one dash can not be valid as that indicates a numbered range
list, which may yield a different list than a named range list with same
first and last variables. So I did some experiment with SAS 9.1.3:

DATA Test; X1=1; X3=3; X5=5; X4=4; X2=2; RUN;
TITLE 'one dash'; PROC PRINT DATA=Test; VAR X1 - X5; RUN;
TITLE 'two dashes'; PROC PRINT DATA=Test; VAR X1 -- X5; RUN;
TITLE 'three dashes'; PROC PRINT DATA=Test; VAR X1 --- X5; RUN;

It luckyly appears that it still works as before: one dash implies a
numbered range list, two dashes imply a named range list and three dashes
are illegal and cause a SAS syntax error.

That means that the SAS 9 documentation is wrong in both cases.

Regards - Jim.
Jim Groeneveld, Netherlands
Statistician, SAS consultant
jim2stat (828)
3/28/2006 10:23:24 AM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

1 Replies

Similar Articles

[PageSpeed] 27

Beste Jim,
I tryied your web site link but the result was as with the tree dashes
in datastep...
Still it is nice to know such possibilities in SAS, i found more subtle
over datastep that I could find elsewhere in the documentation.
Well, it makes our job so well paid, does not it? 


maximnl (10)
3/28/2006 10:23:41 PM