Good Day! I am using using SAS Essentials, by Elliot and Woodward, to get my feet wet with SAS. The following code displays a list of the data after importing the file somedata (in the directory it is somedata.sas7bdat):
*******************************************************
* From SAS ESSENTIALS, Jossey Bass/Wiley *
* (C) 2010 Elliott, Alan C. and Woodward, Wayne A. *
*******************************************************;
PROC DATASETS;
CONTENTS DATA= "/folders/myfolders/sasdata/somedata";
RUN;
However, the authors say to display information about all data sets in the sasdata library I should
CONTENTS DATA= "/folders/myfolders/sasdata/somedata._ALL_";but I do
PROC DATASETS;
CONTENTS DATA= "/folders/myfolders/sasdata/sasdata._ALL_";
RUN;
Log is:
Usually the notation suggestion is LIBNAME._all_
So your code should look like the following, assuming your libname is correct. Note that proc datasets requires a QUIT.
libname mylib '/folders/myfolders/sasdata/sasdata';
PROC DATASETS;
CONTENTS DATA= mylib._all_;
RUN;QUIT;
The book lists notations like in your code, including the portion in blue?
PROC DATASETS;
CONTENTS DATA= "/folders/myfolders/sasdata/somedata";
RUN;
No Sir. I had to modify the original file location because I am using the University Edition, and as you are well aware, I have to put all my files (and subdirectories, ie. sasdata) where they are to be accesible to Virtual box. the original code was:
DATAFILE= C:\SASDATA\SOMEDATA;
Hope this answers your question and most appreciative for any assistance
Not a Sir.
Your name is the same as a good friend. My deepest and most sincere apologies!
They appear to be using a non-standard convention. I would recommend a different book to learn from.
The Little SAS Book for SAS University Edition is probably a better starting point.
Usually the notation suggestion is LIBNAME._all_
So your code should look like the following, assuming your libname is correct. Note that proc datasets requires a QUIT.
libname mylib '/folders/myfolders/sasdata/sasdata';
PROC DATASETS;
CONTENTS DATA= mylib._all_;
RUN;QUIT;
This works. Most appreciative!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.