libname bikes base "c:/mac/home/desktop/storm_summary";
proc print data=bikes.storm_summary;
run;
is that the right code for creating library bikes
its not enabling me to create this library
@ambreen wrote:
libname bikes base "c:/mac/home/desktop/storm_summary";
proc print data=bikes.storm_summary;
run;
is that the right code for creating library bikes
its not enabling me to create this library
You have to use the name of a folder on your computer that actually exists. And I don't think "base" belongs in the Libname statement at all. And if you are on Windows, you would want a backslash instead of a forward slash (although it may work with the forward slashes)
libname pg1 "c:Mac/Home/Desktop/EPG194/data";
If I have to create a library named as pg1
how can I do it
and I have to use the above mentioned file path
Hi:
The STORM_SUMMARY data set is one of the names that we use for the Programming 1 course. Are you doing Programming 1? If so, you have to follow the instructions to make the data by running a program. The name of the library that we recommend for class is PG1. For various interfaces, the correct LIBNAME statements would be:
If you are using SAS University Edition in a Virtual Machine, then your LIBNAME statement would look like #2. If you are using SAS OnDemand for Academics, then LIBNAME statement #1. If you are, for example, using SAS on a Mac in a Parallels or BootCamp then you should have a C: drive on your Windows installation in the Windows partition and then you would use #4a.
You do NOT use the file name in a LIBNAME statement. The LIBNAME statement for a SAS library points to the high-level location of the folder for all the SAS data. If I were going to run PROC CONTENTS on the STORM_SUMMARY data, using a LIBNAME statement, as shown above, then the code would be:
proc contents data=PG1.storm_summary;
run;
If I were going to use the fully qualified path folder location and file name for SAS University Edition, as an example, then the code would be:
proc contents data="/folders/myfolders/EPG194/data/storm_summary.sas7bdat";
run;
for SAS OnDemand for Academics, it would be:
proc contents data="/home/<yourUserID>/EPG194/data/storm_summary.sas7bdat";
run;
for EG, it would be:
proc contents data="&path/storm_summary.sas7bdat";
run;
of course, if you're NOT doing Programming 1 and you have some random bike data that happens to use a file called storm_summary which is different from the Programming 1 data, then you still have to write the appropriate LIBNAME statement, but again, unless your folder is named storm_summary, the table names don't belong in the LIBNAME statement for a SAS data set.
Hope this helps,
Cynthia
Hi
I am doing programing 1
Hi:
Are you running SAS in Parallels or in BootCamp? if so, you should have Windows installed in the Mac partition.
You should be able to open Windows Explorer in your partition and find the location of the EPG194 data. You CANNOT use Macintosh names. I only put C:\SAS_class\EPG194\data because that is where I unzipped the zip archive from the instructions. If you have NOT created a C:\SAS_class\EPG194 folder and unzipped the class folders and files there, then using that path will NOT work.
Using a Mac path will NOT work.
You need to find the path location INSIDE Parallels or BootCamp where the EPG194 folder is. Then you need to use THAT location in your code.
Hope this helps,
Cynthia
Unfortunately, I no longer have Parallels on a Mac to test with, but when I did have a Mac with Parallels and with SAS in the Parallels Windows partition, I was able to use Windows Explorer to make folders and find files.
I had a similar issue this week using with SAS in Parallels. It was difficult to find a solution online that worked for me, but I solved it on my own. I wanted to share in case it is useful to anyone.
To solve this issue, I clicked on the Windows Icon on my Mac menu bar. Then, I selected "recommended" which showed recently opened files and their pathways. This is how I could see that the folder I wanted to use for my libname was:
\\Mac\Home\Desktop\folder_name
(note: you'd need to replace "desktop" with the location e.g. "Downloads." You'd also need to replace the folder name or add additional sub-folder names depending on the location)
So I entered:
libname A "\\Mac\Home\Desktop\folder_name";
And that worked for me as of Nov 30, 2022. I hope this helps others!
So it looks like Parallels (a way to run Windows in virtual machine on a Mac) is treating access to the actual DISK on the Mac as if it was a Windows shared drive.
So \\Mac is the name of the SERVER that is sharing the drive.
and \Home is the sharename of the directory being shared.
I would assume that \\Mac\Home is mapped to some folder in the Unix filesystem of the Mac that is running the virtual machine. Since it is showing \Desktop right under that directory then perhaps it is actually mapped directly to the home directory of the Mac userid that you used to sign onto the Mac.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.