BookmarkSubscribeRSS Feed
ambreen
Calcite | Level 5

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

9 REPLIES 9
PaigeMiller
Diamond | Level 26

@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)

--
Paige Miller
ambreen
Calcite | Level 5

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

Cynthia_sas
SAS Super FREQ

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:

correct_libname.png

 

  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

ambreen
Calcite | Level 5

Hi

 

 I am doing programing 1

 

 

 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 libname pg1 "Mac/Home/Desktop/EPG194/data";
NOTE: Library PG1 does not exist.
74
75 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
88
 
 
 
 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 libname pg1 "c:\SAS_CLASS\EPG194\data";
NOTE: Library PG1 does not exist.
74
75
76 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
89
 
 
 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 libname pg1 "c:/Mac/Home/Desktop/EPG194/data";
NOTE: Library PG1 does not exist.
74
75 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 
 
 
ABOVE MENTIONED ARE THE LOG THAT i AM GETTIG AFTER TRYING ALL POSSIBLE PATH i COULD 
now I am getting low I cant create this library
Cynthia_sas
SAS Super FREQ

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.

PaigeMiller
Diamond | Level 26
 
73 libname pg1 "Mac/Home/Desktop/EPG194/data";
 
This folder does not exist. So you can't use it. It's the same as in Microsoft Word or Excel, you can only save files to folders that exist. You need to find the EXACT name of the folder as seen in the operating system used by SAS (which could be UNIX running on a PC or MAC, or it could be Windows or OSX depending on how SAS is installed).
--
Paige Miller
Reeza
Super User
YOU'RE NOT USING SAS UE. YOU'RE USING YOUR OWN SET UP.

IN PARALLELS SET UP YOUR OWN PATH TO THE YOUR LOCAL DRIVE.

VIRTUAL MACHINES CANNOT ACCESS YOUR LOCAL DRIVE BY DEFAULT.

FIND THE PATH IN THE WINDOWS SIDE AND THEN USE THAT. IN WINDOWS, RIGHT CLICK THE FILE wHile holding down CTRL+SHIFT and select copy path. Use that path.

This will solve your issue.
CXavierHall
Calcite | Level 5

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!

 

 

Tom
Super User Tom
Super User

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.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 1399 views
  • 4 likes
  • 6 in conversation