BookmarkSubscribeRSS Feed
dan007004
Fluorite | Level 6

Hi all,

 

I have just downloaded SAS University edition and starting on my study. As instructed SASUser in University Edition is actually NOT writable, so I created a redirect using the redirect (1), the output was successful (2).

 

Then I tried to run a standard code (3) and receive an error. Can anyone please tell me how to avoid this. I thought the redirect would work?

 

Thanks,

 

 

 

1. Submitted Redirect:-

 

libname sasuser "/folders/myfolders/certprep";

 

2. Log:-

 

Version:1.0 StartHTML:000000293 EndHTML:000108984 StartFragment:000108047 EndFragment:000108850 StartSelection:000108047 EndSelection:000108850 SourceURL:http://localhost:10080/SASStudio/371/main?locale=en_GB&zone=GMT%252B01%253A00&http%3A%2F%2Flocalhost%3A10080%2FSASStudio%2F371%2F= SAS Studio

 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 libname sasuser "/folders/myfolders/certprep";
NOTE: Libref SASUSER refers to the same physical library as CERTPREP.
NOTE: Libref SASUSER was successfully assigned as follows:
Engine: V9
Physical Name: /folders/myfolders/certprep
74
75 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
88
 
3. Code from book
data sasuser.admit2; 
  set sasuser.admit; 
   where age>39;run;
 
proc print data=sasuser.admit2;
 
run;
 
4:- Log
 
 
 
 
Version:1.0 StartHTML:000000293 EndHTML:000110368 StartFragment:000108053 EndFragment:000110234 StartSelection:000108053 EndSelection:000110234 SourceURL:http://localhost:10080/SASStudio/371/main?locale=en_GB&zone=GMT%252B01%253A00&http%3A%2F%2Flocalhost%3A10080%2FSASStudio%2F371%2F= SAS Studio
 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73
74 data sasuser.admit2;
75 set sasuser.admit;
ERROR: File SASUSER.ADMIT.DATA does not exist.
76 where age>39;
77 run;
 
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set SASUSER.ADMIT2 may be incomplete. When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set SASUSER.ADMIT2 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.00 seconds
 
 
78
79 proc print data=sasuser.admit2;
80
81 run;
 
NOTE: No variables in data set SASUSER.ADMIT2.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
 
 
82
83
84 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
97

 

 

9 REPLIES 9
Cynthia_sas
SAS Super FREQ
Hi:
Did you run the program that MAKES the data? In the 4th edition, the link to the program code that makes the ADMIT and other data is contained in Chapter 1. For either edition, the link to the program is contained here: https://support.sas.com/content/dam/SAS/support/en/books/data/sampledata.txt Note that the prepared date is in April 2018. You MUST run this setup program AFTER you do the redirect and BEFORE you run any other programs from the Prep Guide.

Did you run the April 2018 program to actually make the data files used in the Prep Guide?

Cynthia
dan007004
Fluorite | Level 6
Hi Cynthia

I didn't create the data no. Is this why I an experiencing the error? No data present?

How do I load the data and where?

Also, I have tried loading files into sas university edition from text or excel. It doesn't work. Does this version support loading files?

Thanks Dan.
Cynthia_sas
SAS Super FREQ

Hi:

  Yes, that is the likely cause of your issue. As I explained in my original post:

"For either edition, the link to the program is contained here: https://support.sas.com/content/dam/SAS/support/en/books/data/sampledata.txt Note that the prepared date is in April 2018. You MUST run this setup program AFTER you do the redirect and BEFORE you run any other programs from the Prep Guide."

 

  You must click that LINK to open a window that contains the program you need to run. You'll need to submit your "redirect" libname statement first and then copy and paste the program into SAS Studio, run the program. After that, you should be able to navigate to the "certprep" folder in the Files and Folder pane and you'll see all the files created. You have only to do this once and then every other time you want to use the data, you only have to issue the LIBNAME statement as needed.

 

  Yes, the SAS University Edition does allow reading TXT files. There are examples of that in the Prep Guide and in many, many other postings on the Forums. The SAS University Edition can also read Excel files: XLS and XLSX and CSV files, and there are many, many other postings on the forums about that too.

 

  The bottom line with reading TXT or Excel files is understanding where you put the files in your shared folders location. The easiest thing to do is this:

1) put the TXT file or Excel file in your shared folders location, which on windows should be a folder location like:

c:\SASUniversityEdition/myfolders

2) Once inside SAS Studio, go to the Files and Folders pane and look for your TXT file under the MyFolders icon.

3) If you see your file, then right click on the file and choose Properties -- you will see the path you need to use in Properties -- copy this path location and file name

4) use THIS information from Properties in your code

 

When you finished installing SASUniversity Edition, one of the last steps was making a myfolders folder and defining that folder as your shared folder location in Virtual Box or VMWare.

 

You CANNOT use Windows pathnames in SAS Studio. For example, if your Windows location for a file is:

c:\SASUniversityEdition\myfolders\wombat.txt

then your path in properties (assuming you defined Shared Folders correctly) would be:

/folders/myfolders/wombat.txt

 

Color coding is intended to show how the high-level windows path turns into a Unix path that points to the shared folder location for reference in SAS University Edition.

 

Hope this helps,

cynthia

dan007004
Fluorite | Level 6
Thanks Cynthia. That's fab. I will review in the morning.
Reeza
Super User

I would also recommend never doing that redirect from the SASUSER library if its locked down, it's done for a reason. So I would create my own library and replace sas user in the training notes. I believe the newer training material has already been updated to reflect this change. 

 

 

Cynthia_sas
SAS Super FREQ
Hi, Reeza:
He's doing the Prep Guide, not a training class and unfortunately, they need to do the redirect on SASUSER to work with the Prep Guide material. At least for the 3rd and 4th Editions of the Base Programmer Prep Guide and the 4th Edition of the Advanced Prep Guide.

People who are using SAS OnDemand for Academics or SAS University Edition do NOT have write access to SASUSER, and so a redirect like this in those 2 interfaces:
libname sasuser '/folders/myfolders/certprep';

is what we recommend. The book still refers to SASUSER datasets in a few places and folks who run SAS on Windows (via Display Manager) can get the datasets written to their local SASUSER without any issues. So to avoid having to change ALL the SASUSER references in all the code examples to something else, for the short term, we recommend a redirect as indicated in the Content updates.

Cynthia
Tom
Super User Tom
Super User

In my experience it was NEVER a good idea to write any data to the SASUSER library.  All you had to do was launch two SAS sessions at the same time and you can no longer find your data and your programs fail.

 

When are they going to update ALL of the training materials to remove that mistake?

Cynthia_sas
SAS Super FREQ
Hi:
The Prep Guide is produced by a different group than the Education group that produces the training classes. Our classes do not refer to SASUSER. A few classes refer to SASHELP data, but for most classes, the students have to run a program to make the data used in class.
For the Prep Guide, the files were originally written to SASUSER because there were some Display Manager Getting Started tutorials that wrote files to SASUSER.

That original set of tutorial data files was the first set of data files used for the first Prep Guide edition.

I believe the plan is to transition the Prep Guide away from SASUSER as a location for data.

Cynthia

.

dan007004
Fluorite | Level 6
Hi Cynthia

Thank you very much. The data load fixed the issue. I can now point to sasuser and redirects successfully

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1087 views
  • 4 likes
  • 4 in conversation