DATA Step, Macro, Functions and more

ERROR: File STATDATA.TESTSCORES.DATA does not exist.

Reply
New Contributor
Posts: 2

ERROR: File STATDATA.TESTSCORES.DATA does not exist.

libname statdata "/folders/myfolders/ECST131"; 
libname library "/folders/myfolders/ECST131";

after this folder successfully assigned.
NOTE: Libref STATDATA refers to the same physical library as LIBRARY.
NOTE: Libref STATDATA was successfully assigned as follows:
Engine: V9
Physical Name: /folders/myfolders/ECST131
63 libname library "/folders/myfolders/ECST131";
NOTE: Libref LIBRARY refers to the same physical library as STATDATA.
NOTE: Libref LIBRARY was successfully assigned as follows:
Engine: V9
Physical Name: /folders/myfolders/ECST131

 

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
OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 proc print data=statdata.testscores (obs=10);
ERROR: File STATDATA.TESTSCORES.DATA does not exist.
63 title 'Listing of the SAT Data Set';
64 run;
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.02 seconds
cpu time 0.00 seconds
 kindly help me to shootout this error

 

PROC Star
Posts: 1,190

Re: ERROR: File STATDATA.TESTSCORES.DATA does not exist.

Posted in reply to BalachandarB

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 Smiley Happy

Super User
Super User
Posts: 9,200

Re: ERROR: File STATDATA.TESTSCORES.DATA does not exist.

Posted in reply to BalachandarB

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.

New Contributor
Posts: 2

Re: ERROR: File STATDATA.TESTSCORES.DATA does not exist.

testscores.sas7bdat. file does not exist in my PC anywhere.

Super User
Super User
Posts: 9,200

Re: ERROR: File STATDATA.TESTSCORES.DATA does not exist.

Posted in reply to BalachandarB

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.

PROC Star
Posts: 1,190

Re: ERROR: File STATDATA.TESTSCORES.DATA does not exist.

Posted in reply to BalachandarB

does testscores exist on your PC in some other format? And if yes, what format?

Super User
Posts: 9,560

Re: ERROR: File STATDATA.TESTSCORES.DATA does not exist.

Posted in reply to BalachandarB

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Posts: 9,560

Re: ERROR: File STATDATA.TESTSCORES.DATA does not exist.

Posted in reply to BalachandarB

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
New Contributor
Posts: 3

Re: ERROR: File STATDATA.TESTSCORES.DATA does not exist.

Posted in reply to BalachandarB

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.

Super User
Super User
Posts: 7,847

Re: ERROR: File STATDATA.TESTSCORES.DATA does not exist.

Posted in reply to BalachandarB

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.

Ask a Question
Discussion stats
  • 9 replies
  • 158 views
  • 2 likes
  • 6 in conversation