BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jmarroyo
Fluorite | Level 6

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:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 *******************************************************
57 * From SAS ESSENTIALS, Jossey Bass/Wiley *
58 * (C) 2010 Elliott, Alan C. and Woodward, Wayne A. *
59 *******************************************************;
60 PROC DATASETS;
61 CONTENTS DATA= "/folders/myfolders/sasdata/sasdata._ALL_";
ERROR: Extension for physical file name "/folders/myfolders/sasdata/sasdata._ALL_" does not correspond to a valid member type.
NOTE: Enter RUN; to continue or QUIT; to end the procedure.
62 RUN;
 
NOTE: Statements not processed because of errors noted above.
63
64
65 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
77
 
Any suggestions?
  Most appreciative
 
PS I am using SAS University ed on Windows 7 VM Virtual Box Manager
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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;

View solution in original post

7 REPLIES 7
Reeza
Super User

The book lists notations like in your code, including the portion in blue?

 

PROC DATASETS;
CONTENTS DATA= "/folders/myfolders/sasdata/somedata";
RUN;

jmarroyo
Fluorite | Level 6

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

Reeza
Super User

Not a Sir. 

 

jmarroyo
Fluorite | Level 6

Your name is the same as a good friend. My deepest and most sincere apologies!

Reeza
Super User

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. 

Reeza
Super User

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;
jmarroyo
Fluorite | Level 6

This works. Most appreciative!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 5015 views
  • 1 like
  • 2 in conversation