SAS studio, I cannot open a dataset

1k Views Asked by At

I cannot open a dataset using SAS Studio.

I am following this online resource (https://stats.idre.ucla.edu/sas/dae/probit-regression/). After downloading the data " binary.sas7bdat" and uploading the data inside SAS studio's personal folder, I have run:

proc means data="\folders\myfolders\binary";

var gre gpa;

run;

as explained in the UCLA file, but I obtain an error. How can I obtain summary statistics? Is my way of inputting the data incorrect?

3

There are 3 best solutions below

0
On BEST ANSWER

There's a couple of things in the post that are problematic. I recommend using the SAS training courses to learn, they're free and designed for SAS UE, so less of these type of issues.

Anyways, first, you should place the data in the myfolders library that you set up. You can use the Upload feature, however that has a 10MB restriction that you'll run into quickly. To get around it, place the file in the folder you created at installation and that you mapped to myfolders. You can also save your code here as well.

Then you create the library and reference as indicated by @Joe in his answer.

libname tells SAS where the files are stored. the data set name is binary. SAS files are references as LIBNAME.DATANAME.

libname mydata '/folders/myfolders';

proc datasets lib=mydata;run;quit;

And check the log for the list of data sets available.

3
On

You normally would use a LIBNAME statement to direct studio to your data:

libname mydata "\folders\myfolders\";
proc means data=mydata.binary ... 

But you can also do it directly with the extension:

proc means data="\folders\myfolders\binary.sas7bdat";
var gre gpa;
run;

Note: I don't have University Edition so I'm not 100% sure if your pathing is correct. Normally at minimum it would be '/' not '\' since it's technically in Unix.

0
On

SAS UE is running in a virtual unix environment. In Unix you use / between directory levels, not \ like in DOS/Windows.

SAS is smart enough to automatically convert / to \ on Windows, but on Unix it cannot make the switch for you because \ could validly be used in Unix paths to escape special characters, such as spaces.

So instead of looking for the file /folders/myfolders/binary.sas7bdat you asked it to find a file named foldersmyfoldersbinary.sas7bdat in the current working directory.