Write and run SAS programs in your web browser

ERROR: File WORK.YEAR.DATA does not exist

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 19
Accepted Solution

ERROR: File WORK.YEAR.DATA does not exist

Hello All,

I was trying to see the climate data (temperature) trend over time for combined sites. I have load the data using the command and it was successful.   However, when I tried to model it with the command than an error occurred. It said ERROR: File WORK.YEAR.DATA does not exist. Can you please help me to solve the problem? Thanks.

/** Import an XLSX file.  **/
PROC IMPORT DATAFILE="/folders/myfolders/analysisi/temp.xlsx"
		    OUT=WORK.cc
		    DBMS=XLSX
		    REPLACE;
RUN;
/** Print the results. **/
PROC PRINT DATA=WORK.cc; RUN;



proc mixed data=year;
   temp plot;
   model year =  temp plot temp*plot;
run;

Accepted Solutions
Solution
‎01-15-2016 09:29 AM
Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: ERROR: File WORK.YEAR.DATA does not exist

Hi,

 

In the proc import code you create a dataset in the library WORK, called CC.  You then print the dataset WORK.CC.  You then attempt to run a proc mixed on a dataset WORK.YEAR.  At no point in the code you have given is a dataset WORK.YEAR created, mayeb you meant to put WORK.CC in there.

 

View solution in original post


All Replies
Solution
‎01-15-2016 09:29 AM
Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: ERROR: File WORK.YEAR.DATA does not exist

Hi,

 

In the proc import code you create a dataset in the library WORK, called CC.  You then print the dataset WORK.CC.  You then attempt to run a proc mixed on a dataset WORK.YEAR.  At no point in the code you have given is a dataset WORK.YEAR created, mayeb you meant to put WORK.CC in there.

 

Occasional Contributor
Posts: 19

Re: ERROR: File WORK.YEAR.DATA does not exist

[ Edited ]

Thanks for your reply. In that case, the code looks like proc mixed data= WORK.cc;
temp plot;
model year = temp plot temp*plot;
run;

Actually WORK.cc is the spreedsheet name. Than what would be my proper code for proc mixed. Here year is the dependent variable. Can you please help to write the proper code. Sorry for asking so many questions. I am very new in SAS. Thanks

Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: ERROR: File WORK.YEAR.DATA does not exist

Not sure I follow, the spreadsheet is called 

"/folders/myfolders/analysisi/temp.xlsx" 

 From that you create a SAS dataset in WORK called CC with the line:

 OUT=WORK.cc

So your correction to the proc should work:

proc mixed data= WORK.cc;
  temp plot;
  model year = temp plot temp*plot;
run;

 

However, as you are importing from Excel using a guessing procedure, it is left up to SAS to decide what to call the columns  and what lengths on the CC dataset created.  These may come from the column headings in your Excel file, they may be different.  You need to look at the attributes of the dataset CC -> you can right click on the dataset in SAS explorer and select properties.  Ensure you have a variable called year.  As for the model itself, thats really up for you to decide if its the right model for your purpose.

Occasional Contributor
Posts: 19

Re: ERROR: File WORK.YEAR.DATA does not exist

Thanks
☑ This topic is SOLVED.

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

Discussion stats
  • 4 replies
  • 4502 views
  • 1 like
  • 2 in conversation