Learning SAS? Welcome to the exclusive online community for all SAS learners.

Absolute beginner watching youtube videos

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Absolute beginner watching youtube videos

Hello everyone,

Complete beginner here attempting to self study by following the youtube videos for now

I am watching the youtube video labeled Accessing Data in SAS libraries, I am trying to create a library named 'LIBSAS" as the video is showing however whenever I run the code this is what my results are:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

42 ;

43 libname libsas 'C:\Users\Oprah\Documents\SASUniversityEdition\myfolders\sasuser.v94\Cars';

NOTE: Library LIBSAS does not exist.

44 

45

45 ! data europeancars;

46 set sashelp.cars;

47 where origin="Europe";

48 run;

NOTE: There were 123 observations read from the data set SASHELP.CARS.

  WHERE origin='Europe';

NOTE: The data set WORK.EUROPEANCARS has 123 observations and 15 variables.

NOTE: DATA statement used (Total process time):

  real time 0.01 seconds

  cpu time 0.01 seconds

  

49 

50 proc print data=europeancars;

51 run;

NOTE: There were 123 observations read from the data set WORK.EUROPEANCARS.

NOTE: The PROCEDURE PRINT printed pages 58-60.

NOTE: PROCEDURE PRINT used (Total process time):

  real time 1.19 seconds

  cpu time 1.23 seconds

  

51 ! /My SAS Files/Cars";

  _ __

  180 49

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space

  between a quoted string and the succeeding identifier is recommended.

52 

53 data libsas.europeancars;

54 set sashelp.cars;

55 where Origin="Europe:;

56 run;

57 

58 proc print data=libsas.europeancars;

ERROR: File LIBSAS.EUROPEANCARS.DATA does not exist.

59 run;

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE PRINT used (Total process time):

  real time 0.00 seconds

  cpu time 0.01 seconds

  

60 ;

61 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

71 ;

Any suggestions?

Thank you ahead of time


Accepted Solutions
Solution
‎06-22-2014 10:01 AM
SAS Super FREQ
Posts: 8,868

Re: Absolute beginner watching youtube videos

Posted in reply to bruceleeroy

Hi:

  You probably need to read some more postings on the forum, like this one  https://communities.sas.com/message/216397#216397 which has some screen shots comparing the Windows Explorer view of the data with the SAS Studio view of the folders and data.

    Basically, you need to

1) you have to make the shared folders

2) you have to put your existing datasets into the shared folder or run code to get the data into the folders

3) you have to point to your shared folder with a LIBNAME statement

    

  However, let's try something simpler first and make the data in WORK to get you started:

   

data work.europeancars;

  set sashelp.cars;

  where Origin="Europe";

run;

     

proc print data=work.europeancars;

run;

  

Then, after that makes you a work dataset, try this:

 

libname libsas '/folders/myfolders';

   
data libsas.europeancars;

  set sashelp.cars;

  where Origin="Europe";

run;

   

proc print data=libsas.europeancars;

run;

   

  I am not on a machine with SAS Studio right now, but assuming that your screen shot was correct and you have set up the right path, then you should be able to make a permanent copy of your europeancars dataset with a LIBNAME similar to what I show.

  

cynthia

View solution in original post


All Replies
Super User
Posts: 19,861

Re: Absolute beginner watching youtube videos

Posted in reply to bruceleeroy

How do I create a shared folder in VMware player or VMware Fusion?

How do I reference SAS data within a SAS program?

2 things to check, one you need to unix path, so you need to use a forward slash in your paths and secondly you need to set up the shared drive on your VM.

SAS Employee
Posts: 3

Re: Absolute beginner watching youtube videos

Posted in reply to bruceleeroy

So glad to hear you're getting started with SAS! Keep us posted on your learning experience. Happy programming! Erin

Occasional Contributor
Posts: 9

Re: Absolute beginner watching youtube videos

Posted in reply to bruceleeroy

Hey I've tried the suggestions above and still no luck.

Here's my code basically copied straight from the youtube video:

libname libsas 'C:/Users/Oprah/Documents/SASUniversityEdition/myfolders';

data libsas.europeancars;

  set sashelp.cars;

  where Origin="Europe";

run;

proc print data=libsas.europeancars;

run;

Here's the log:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

42 ;

43 libname libsas 'C:/Users/Oprah/Documents/SASUniversityEdition/myfolders';

NOTE: Library LIBSAS does not exist.

44

45 data libsas.europeancars;

46 set sashelp.cars;

47 where Origin="Europe";

48 run;

ERROR: Library LIBSAS does not exist.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: DATA statement used (Total process time):

  real time 0.01 seconds

  cpu time 0.01 seconds

 

49

50 proc print data=libsas.europeancars;

ERROR: File LIBSAS.EUROPEANCARS.DATA does not exist.

51 run;

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE PRINT used (Total process time):

  real time 0.00 seconds

  cpu time 0.01 seconds

 

52 ;

53 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

63 ;

SAS.png

Here's how the shared folder looks. I tried using forward slashes here too but once I save it just reverts to backslahses

Any help please, I want to try and understand this before I move on.

Thank you ahead of time

Occasional Contributor
Posts: 9

Re: Absolute beginner watching youtube videos

Posted in reply to bruceleeroy

Im using virtualbox, should i maybe use another program?

Solution
‎06-22-2014 10:01 AM
SAS Super FREQ
Posts: 8,868

Re: Absolute beginner watching youtube videos

Posted in reply to bruceleeroy

Hi:

  You probably need to read some more postings on the forum, like this one  https://communities.sas.com/message/216397#216397 which has some screen shots comparing the Windows Explorer view of the data with the SAS Studio view of the folders and data.

    Basically, you need to

1) you have to make the shared folders

2) you have to put your existing datasets into the shared folder or run code to get the data into the folders

3) you have to point to your shared folder with a LIBNAME statement

    

  However, let's try something simpler first and make the data in WORK to get you started:

   

data work.europeancars;

  set sashelp.cars;

  where Origin="Europe";

run;

     

proc print data=work.europeancars;

run;

  

Then, after that makes you a work dataset, try this:

 

libname libsas '/folders/myfolders';

   
data libsas.europeancars;

  set sashelp.cars;

  where Origin="Europe";

run;

   

proc print data=libsas.europeancars;

run;

   

  I am not on a machine with SAS Studio right now, but assuming that your screen shot was correct and you have set up the right path, then you should be able to make a permanent copy of your europeancars dataset with a LIBNAME similar to what I show.

  

cynthia

Occasional Contributor
Posts: 9

Re: Absolute beginner watching youtube videos

Posted in reply to Cynthia_sas

Thank you Cynthia, that worked : )

Frequent Contributor
Posts: 118

Re: Absolute beginner watching youtube videos

Posted in reply to bruceleeroy

Hi,

Warm welcome to the SAS family.

I am writing posts for beginners, May be it could help you...

http://www.sascertguru.com/2014/06/why-we-use-force-option-in-proc-append.html

Regards

Uma Shanker Saini

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 1941 views
  • 3 likes
  • 5 in conversation