Set yourself apart with a SAS Certification credential

How to get SASUSER library's data sets

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

How to get SASUSER library's data sets

I want to run this particular code. 

 

data sasuser.admit2;
set sasuser.admit;
where age>39;
run;
proc print data=sasuser.admit2;
run;

 

The above code didn't actually execute in SAS university edition because the data set sasuser.admit data set is not present in my system.

 

I ran the code given in the following link and executed the same

 

support.sas.com/publishing/cert/sampdata.txt

 

the code got executed, and it created many files in sasuser folder in  '/folders/myfolders/', but i am not able to see any data set in the sasuser library. Its just showing SASUSER which was already there long before i executed the code given in the above link.

 

Among the many files created as a result of executing the above code in the link, a file name admit was also created with .DAT extension . 

 

i tried running the same code again.

 

data sasuser.admit2;
set sasuser.admit;
where age>39;
run;
proc print data=sasuser.admit2;
run;

 

but it will show an error like:

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 data sasuser.admit2;
57 set sasuser.admit;
ERROR: File SASUSER.ADMIT.DATA does not exist.
58 where age>39;
59 run;
 
ERROR: Write access to member SASUSER.ADMIT2.DATA is denied.
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
 
60 proc print data=sasuser.admit2;
ERROR: File SASUSER.ADMIT2.DATA does not exist.
61 run;
 
 
Even though files are showing up in  /folders/myfolders/ but the same files are not showing up as data set in the library section of SAS univesity edition, due to which i am not able to execute the above code. Please assist to bring data sets under SASUSER.

SASUSER error1.JPGSASUSER error.JPG

Accepted Solutions
Solution
‎10-24-2016 12:09 AM
SAS Super FREQ
Posts: 8,820

Re: How to get SASUSER library's data sets

Hi:

  The bottom line is that you cannot use the default SASUSER library with the program that makes the Prep Guide data -- because, by default, the SAS UE users and SAS OnDemand for Academic users and some EG users do NOT have write access to the default SASUSER location. However, as indicated in this web site (which has an updated version of the Prep Guide program for UE users), you can make the datasets and still use a reference to SASUSER. Please note that you do NOT have to edit the program, but you do have to follow ALL of the instructions you will find here:

http://support.sas.com/publishing/cert/basecertguide3.html

 

  Please play particular attention to step #3, which explains how you "redirect" your default SASUSER library to a new location to which you do have write access. In the #3 step, a suggestion is made that you make a folder called "certprep" and then you can redirect your SASUSER reference using this LIBNAME statement:

libname sasuser "/folders/myfolders/certprep";

  As is says in step #3, you must use the filename of the new directory. In their examples, they use the name certprep. If you use another filename, substitute the name that you created for certprep in the above LIBNAME statement.

 

  Once you follow the instructions as shown on the web site, you only need to follow the link on the above web page to get the program and then run the program.

 

  Because the LIBNAME statement has redirected SASUSER to a different location where you have WRITE access, the programs in the Base and Advanced Prep Guides (which use the same data files) should now work for you.

 

  Hope this helps clarify that you do NOT need to change the program the above web site has the updated program; you do not need to write to training@sas.com as you did in the past because the above web site has the updated program and instructions; and, perhaps you detect the theme of this posting,  the web site above contains the instructions that you need to follow and the program you need to run to work with the Base and Advanced Prep Guides.

 

cynthia

 

 

View solution in original post


All Replies
Super User
Posts: 19,157

Re: How to get SASUSER library's data sets

Contact training@sas.com for the code for SAS UE. 

Super User
Posts: 7,431

Re: How to get SASUSER library's data sets

- On SAS UE, the SASUSER library is read-only. You can't put anything there. Even if you already had the dataset there, your step would not work.

- to use the files in /folders/myfolder, you need to define a libname for that location:

libname mylib '/folders/myfolder';

You can then use library mylib to reference your practice datasets.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 3

Re: How to get SASUSER library's data sets

Thank you very much for your response.I did as you said and wrote the following code.

 

libname mylib '/folders/myfolders/mylib1';
data mylib.admit2;
set mylib.admit;
where age<39;
run;
proc print data=mylib.admit2;
run;

 

However, i am still receiving the error in the log window " ERROR: File MYLIB.ADMIT.DATA does not exist."

 

the data set is in the folder mylib1 but it says the data set does not exist, and the current data set 'admit' only have observations, no attributes are assigned to it. What is the way out to access this data set without errors

Super User
Posts: 7,431

Re: How to get SASUSER library's data sets

Since you are using SAS UE, take a look at the shared folder with the Windows explorer to determine the path leading to those files.

Then use the internal UNIX equivalent for the libname.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 19,157

Re: How to get SASUSER library's data sets

You have to first modify the sample code so the datasets are generated in the correct library. 

 

 

See the discussion here. 

https://communities.sas.com/t5/General-SAS-Programming/SAS-Certification-program-problem/m-p/188775#...

Solution
‎10-24-2016 12:09 AM
SAS Super FREQ
Posts: 8,820

Re: How to get SASUSER library's data sets

Hi:

  The bottom line is that you cannot use the default SASUSER library with the program that makes the Prep Guide data -- because, by default, the SAS UE users and SAS OnDemand for Academic users and some EG users do NOT have write access to the default SASUSER location. However, as indicated in this web site (which has an updated version of the Prep Guide program for UE users), you can make the datasets and still use a reference to SASUSER. Please note that you do NOT have to edit the program, but you do have to follow ALL of the instructions you will find here:

http://support.sas.com/publishing/cert/basecertguide3.html

 

  Please play particular attention to step #3, which explains how you "redirect" your default SASUSER library to a new location to which you do have write access. In the #3 step, a suggestion is made that you make a folder called "certprep" and then you can redirect your SASUSER reference using this LIBNAME statement:

libname sasuser "/folders/myfolders/certprep";

  As is says in step #3, you must use the filename of the new directory. In their examples, they use the name certprep. If you use another filename, substitute the name that you created for certprep in the above LIBNAME statement.

 

  Once you follow the instructions as shown on the web site, you only need to follow the link on the above web page to get the program and then run the program.

 

  Because the LIBNAME statement has redirected SASUSER to a different location where you have WRITE access, the programs in the Base and Advanced Prep Guides (which use the same data files) should now work for you.

 

  Hope this helps clarify that you do NOT need to change the program the above web site has the updated program; you do not need to write to training@sas.com as you did in the past because the above web site has the updated program and instructions; and, perhaps you detect the theme of this posting,  the web site above contains the instructions that you need to follow and the program you need to run to work with the Base and Advanced Prep Guides.

 

cynthia

 

 

Occasional Contributor
Posts: 10

Re: How to get SASUSER library's data sets

I have a similar error when trying to do the base cert prep guide practice using UE. followed the above instructions, Now I've setup the data without errors (not sure if the entire practice set is actually successfully setup though.), created a new folder "certprep" under "myfolder" and re-directed the library to certprep (libname sasuser "/folders/myfolders/certprep"Smiley Wink. but when trying the first practice in chapter 2 i'm still getting the error saying the "Mylib does not exist". Not sure what went wrong and how to fix. this is the log:

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62
63
64
65 libname MYLIB 'SAS-data-library';
NOTE: Libref MYLIB refers to the same physical library as CERTPREP.
WARNING: Library MYLIB does not exist.
NOTE: Libref MYLIB was successfully assigned as follows:
Engine: V9
Physical Name: /opt/sasinside/SASConfig/Lev1/SASApp/SAS-data-library
66 data MYLIB.admit;
67 set sasuser.admit;
68 if ActLevel="HIGH";
69 run;

ERROR: Library MYLIB does not exist.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds


70 proc print data=mylib.admit;
ERROR: File MYLIB.ADMIT.DATA does not exist.
71 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.00 seconds

72
73 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
86

Super User
Posts: 19,157

Re: How to get SASUSER library's data sets

Libname statement doesn't have a path listed....

 

 

Occasional Contributor
Posts: 10

Re: How to get SASUSER library's data sets

oh, newbie mistake LOL.

 

Thanks Reeza.

☑ This topic is solved.

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

Discussion stats
  • 9 replies
  • 1950 views
  • 5 likes
  • 5 in conversation