I'm running some code in SAS Enterprise Miner 15.1 from a SAS blog:
proc sgscatter data=CARDATA_TRAIN; label make='Make' weight='Weight'; label horse_power='Horse Power' mpg='mpg'; matrix make weight horse_power mpg; run;
I'm getting the error
ERROR: File WORK.CARDATATRAIN.DATA does not exist.
The error is correct as the SAS table is called CARDATA_TRAIN, but SAS has prefixed the table name with "WORK" and suffixed with "DATA". Which is why I'm getting the error!
Why is SAS doing this? How do I over come this? Any advice would be appreciated.
If you do not explicitly provide a library name for a data set then SAS assumes and treats the name as belonging to the WORK library. If you data set is in a different library you must provide the name.
There are a few things that will use other sorts of files that SAS uses such as catalogs or views but if you don't provide that information, where appropriate, the the file is assumed to be a SAS data set. Since you use the name on a DATA= option then SAS tells you that an expected data set was not found. Don't worry about the .DATA, it is only used explicitly in a very small subset of SAS syntax.
The "no observations" is a direct result of the source data set not existing. When you read nothing (the missing dataset) then there are "no observations". Single errors can cause multiple error messages depending on the specific issue.
So, where is the code that created your Cardata_train data set?
If you do not explicitly provide a library name for a data set then SAS assumes and treats the name as belonging to the WORK library. If you data set is in a different library you must provide the name.
There are a few things that will use other sorts of files that SAS uses such as catalogs or views but if you don't provide that information, where appropriate, the the file is assumed to be a SAS data set. Since you use the name on a DATA= option then SAS tells you that an expected data set was not found. Don't worry about the .DATA, it is only used explicitly in a very small subset of SAS syntax.
The "no observations" is a direct result of the source data set not existing. When you read nothing (the missing dataset) then there are "no observations". Single errors can cause multiple error messages depending on the specific issue.
So, where is the code that created your Cardata_train data set?
@azmol wrote:
@ballardw thanks, I think it worked. There is a new error, it's trying to write to the Program Files directory, which it does not have permission to do so:
Cannot write image to C:\Program Files\...
How can I change the output?
You should show the code with messages from the log.
Without complete details the most likely is that you have some sort of server that is executing your code and the path you are attempting to send the output to is actually on that server, where you wouldn't have permission, causing the error. In this case you likely have some sort of work space that has been setup where you can create output but that depends on your SAS configuration.
Another possibility if not working with a server is that you did not provide a full path for your output. If you use a file name like "myoutput.rtf" (or other extension for other output) then SAS defaults to attempting to write to the "active" folder which is frequently the folder SAS executes from.
Generally it is good habit, with any software, to provide file names starting at a drive (Windows) such as "C:\folder\otherfolder\myoutputfilename.ext", or a mount point in Unix.
Many organizations have "locked down" the Program Files directory in windows so you need admin privileges to write any files there and may be the proximate cause of the error. But it isn't a good idea to be sending your output there in the first place.
If you are using SAS University Edition or SAS On Demand for Academics there are other issues as well.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.