DATA Step, Macro, Functions and more

SAS EG complaining file does not exist, but it does

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

SAS EG complaining file does not exist, but it does

Hi,

I'm trying to do a simple LEFT JOIN but when trying to process, SAS tells me the file does not exist. Problem being, of course, the file does exist. Any help?

Here's an example:
PROC SQL;
CREATE TABLE WORK.FINAL_DATA AS
SELECT t1.CAT1,
t1.CAT2,
t2.CAT3,
t1.CAT4

FROM WORK.PRELIM_DATA1 t1
LEFT JOIN WORK.PRELIM_DATA2 t2 ON (t1.CAT1 = t2.CAT1)
WHERE (t1.TIMECAT1 <= t2.TIMECAT1) AND (t1.TIMECAT1 >= t2.TIMECAT2);
QUIT;

So for me it breaks after the WHERE line, telling me that WORK.PRELIM_DATA2.DATA does not exist. Problem is, the table clearly does exist, I can have it open and viewing at the same time I'm trying to execute this query.

Interestingly, this same data also caused SAS to lock up when trying to add it via a Join Tables in the Query Wizard, thus why I'm doing it manually, but something else appears to be causing the issue here.

SAS EG 7.1

Accepted Solutions
Solution
‎09-13-2016 09:21 AM
Super User
Posts: 7,762

Re: SAS EG complaining file does not exist, but it does

Do you see WORK.PRELIM_DATA2 on the exact same workspace server instance where you try to execute the query?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Super User
Posts: 19,771

Re: SAS EG complaining file does not exist, but it does

Can you post the output from a proc contents?

 

proc datasets lib=work;
run;
Occasional Contributor
Posts: 6

Re: SAS EG complaining file does not exist, but it does

I do not show the dataset listed for PRELIM_DATA2 when I run this. Interesting, since it shows on my EG window and the data is viewable. How is this corrected?
Community Manager
Posts: 2,952

Re: SAS EG complaining file does not exist, but it does

With the data open in the data grid, click on the Properties icon (far right side of the toolbar in the data viewer).  Use that to verify the data you're looking at is where you think it is.

Super User
Posts: 19,771

Re: SAS EG complaining file does not exist, but it does

Use the following code to see the library and dataset name. Most likely it's in a library that's not WORK.  

 

proc sql;
select libname, memname, 
from sashelp.vtable
where upper(memname)='PRELIM_DATA2';
quit;
Solution
‎09-13-2016 09:21 AM
Super User
Posts: 7,762

Re: SAS EG complaining file does not exist, but it does

Do you see WORK.PRELIM_DATA2 on the exact same workspace server instance where you try to execute the query?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 6

Re: SAS EG complaining file does not exist, but it does

Posted in reply to KurtBremser

Thanks - this one tipped me off. I was hovering over the table in the EG space and noticed it was on a different server - my SAS has two identical servers, and this one was located on the WORK directory on the other server. Rookie mistake. Man Embarassed

☑ This topic is solved.

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

Discussion stats
  • 6 replies
  • 406 views
  • 6 likes
  • 4 in conversation