libname statdata "/folders/myfolders/ECST131";
libname library "/folders/myfolders/ECST131";
after this folder successfully assigned.
but after running following code
proc print data=statdata.testscores (obs=10);
title 'Listing of the SAT Data Set';
run;
title;
Am recieving a error message as follow
kindly help me to shootout this error
Why do you define the same library to two different libnames?
As the log says.. the testscores data set is not in the statdata library. So go to the statdata library and see if the data set is actually called what you think it is. If SAS says that a data set is not there, it is not there 🙂
Firstly, don't write/code all in mixed case, upper etc. It makes a post so hard to read.
Secondly it is really not a good idea to use SAS reserved words as names, in this case library.
Now onto your problem, the erro is telling you that in the library statdata, which references the physical location on the hard drive of /folders/myfolders/ecst131, there isn't a file testscores.sas7bdat.
To solve this, either point to the correct location, or put the file in that location.
testscores.sas7bdat. file does not exist in my PC anywhere.
So what is the problem then? That files doesn't exist, so you can't write a datastep for it? Are you following some learning materials maybe, and they say to type in that code? Maybe before that there is a step which creates the dataset, so you would have to run that to have data available for this step. Its very hard to try to guess what you are doing, post some information on what you are doing.
does testscores exist on your PC in some other format? And if yes, what format?
@BalachandarB wrote:
testscores.sas7bdat. file does not exist in my PC anywhere.
Then why are you expecting it to be there? You obviously skipped the necessary steps to create/import it.
Since this is happening in the shared folder of SAS UE, you can use Windows Explorer to navigate to the shared folder and see if subfolder ECST131 contains a file named testscores.sas7bdat. Note that the filename must be all lowercase.
Looks like you're running the Statistics 1 demo, right?
Somewhere you'll either be provided with the data to download/obtain somehow, or in a code example you'll be creating this table.
You're assigning the correct library based on the code snippet, you just haven't actually created your data yet.
Also, get rid of the 'libname library' statement, it's a duplicate of the STATDATA libref.
Just a quick note for all of the posters that are commenting on the fact the the original code created two librefs pointing to the same location. The default FMTSEARCH settings for SAS will look for a catalog named LIBRARY.FORMATS to find user defined formats. So it is/was standard coding practice to create a libref named LIBRARY that pointer to your project folder to find your project specific format catalog.
One way to do this that does not require creating the LIBRARY libref is to instead use the FTMSEARCH option to tell SAS to look for formats in the STATDATA.FORMATS catalog instead.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.