Feb
19
SAS studio – dude, where’s my data set?
February 19, 2017 | Leave a Comment
Working on some fun things using SAS Studio, so, expect a number of short posts over the next few days. Last time, I talked about the utilities and how easy it is to import an Excel file. Now let’s say maybe you are not aUnix person and you have no idea how exactly to code a LIBNAME statement that is not on Windows. Never fear, it’s super easy.
Right click on the folder where you want to save your data set. From the menu that appears, select the last choice which is ‘properties’.
A window will come up that shows the name of your folder and its location, it’s easy to spot because it’s right next to the word Location. It will look something like this:
/home/your_name/data_analysis_examples
to save your data you have uploaded an Excel file and imported into SAS, remember that the files were saved in the work directory and named import, import 1 etc.If I wanted to sort those data sets and then merge them together into a permanent data set, I’d do it in the exact same way as if I was using Windows. The only thing different is the LIBNAME statement, as you can see below.
LIBNAME in “/home/your_name/data_analysis_examples”;
Proc sort data = work.import;
By username;
Proc sort data = work.import1;
By username;
data in.crossroads ;
merge work.import work.import1;
By username;
run;
If, later on, I want to use that data set in a program, again I would do it exactly the same as in Windows and the only thing different would be my LIBNAME.
LIBNAME in “/home/your_name/data_analysis_examples”;
Proc means data = in.Crossroads;
Run;
Completely random fact, unrelated to SAS studio, or maybe it is related, I hurt my arm again, so I have been writing my SAS programs using Dragon voice recognition software. If you are going to use SAS studio on a Mac, you should be aware that Dragon does not work on Firefox on the Mac so open up Chrome if you want to use voice recognition software, or at least the software from Dragon. This has nothing to do with SAS specifically.
Comments
Blogroll
- Andrew Gelman's statistics blog - is far more interesting than the name
- Biological research made interesting
- Interesting economics blog
- Love Stats Blog - How can you not love a market research blog with a name like that?
- Me, twitter - Thoughts on stats
- SAS Blog for the rest of us - Not as funny as some, but twice as smart. If this is for the rest of us, who are those other people?
- Simply Statistics, simply interesting
- Tech News that Doesn’t Suck
- The Endeavor -John D Cook - Another statistics blog