Desktop productivity for business analysts and programmers

File Does Not Exist But It does

Accepted Solution Solved
Reply
Contributor
Posts: 36
Accepted Solution

File Does Not Exist But It does

I needed to edit a dataset in a program so I imported an excel document called import then ran a query/join to query the data set.  Then, I pointed that code to the next line of the program.

 

I imported it and under properties it shows GRIDWORK.IMPORT. 

 

Proc SQL:

Create Table Gridwork.Query_B AS

SELECT t1.First_Name,

               t1.Last_Name,

               (Case when t1.First_Name=t2.First_Name then "Y" end)

                AS 'Yes_or_No'n

                FROM Girdwork.Query_A t1

               LEFT JOIN GRIDWORK.IMPORT t2 ON (t1.First_Name=t2.First_Name);

quit;

 

When I run this code it says "File GRIDWORK.IMPORT.DATA does not exist.

I ran the import before running this line of code and it DOES exist. Why does it error?


Thank you.


Accepted Solutions
Solution
2 weeks ago
Contributor
Posts: 36

Re: File Does Not Exist But It does

Turns out it was because it was saved on a different server.  Thanks for the input!

View solution in original post


All Replies
Super Contributor
Posts: 311

Re: File Does Not Exist But It does

Post the log, so that we can see what happened.

Super User
Super User
Posts: 7,720

Re: File Does Not Exist But It does

Yes, would need to see the log.  I would also avoid using keywords, like import for your dataset names.  It shouldn't make any difference, but you never know.  

Contributor
Posts: 36

Re: File Does Not Exist But It does

ERORR: File GRIDWORK.IMPORT.DATA does not exist.

 

Affected Code: LEFT JOIN GRIDWORK.IMPORT t2 ON (t1.FIrst_Name = t2. FIRST Name)

Super User
Super User
Posts: 7,720

Re: File Does Not Exist But It does

Sorry, is that to me?  If so that is not the log, just the error.  Can we see the run of it importing the data and showing the creation of the dataset.  Also please try using another name for the dataset rather than import.

Contributor
Posts: 36

Re: File Does Not Exist But It does

GOPTIONS ACCESSIBLE;

Proc SQL:

Create Table Gridwork.Query_B AS

SELECT t1.First_Name,

               t1.Last_Name,

               (Case when t1.First_Name=t2.First_Name then "Y" end)

                AS 'Yes_or_No'n

                FROM Girdwork.Query_A t1

               LEFT JOIN GRIDWORK.NewDoc ON (t1.First_Name=t2.First_Name);

quit;

ERROR: File GRIDWORK.NewDoc does not exist.

NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.    QUIT;

Super User
Posts: 11,134

Re: File Does Not Exist But It does

Run this code and post the result:

Proc sql;
   select memname
   from dictionary.tables
   where libname='GRIDWORK';
QUIT;

If Newdoc does not appear in the result it doesn't exist. You may have another file that isn't a SAS data set by that name, or perhaps the library Gridwork isn't assigned.

 

Contributor
Posts: 36

Re: File Does Not Exist But It does

I ran the code and Newdoc came up in the result

Super User
Posts: 19,167

Re: File Does Not Exist But It does

Try running a proc contents and post the output.

 

proc contents data=<data name>;

run;

Super User
Super User
Posts: 7,720

Re: File Does Not Exist But It does

Look at the word gridwork in the two lines:

                FROM Girdwork.Query_A t1

               LEFT JOIN GRIDWORK.NewDoc ON (t1.First_Name=t2.First_Name);

 

One of these is incorrect.

Contributor
Posts: 36

Re: File Does Not Exist But It does

That was a typo on my part. After looking at it again they both say Gridwork

Super User
Super User
Posts: 7,720

Re: File Does Not Exist But It does

You will have to go via SAS Support I am afraid, if the library and dataset exists as you say, then there is nothing wrong.

Solution
2 weeks ago
Contributor
Posts: 36

Re: File Does Not Exist But It does

Turns out it was because it was saved on a different server.  Thanks for the input!

☑ This topic is solved.

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

Discussion stats
  • 12 replies
  • 217 views
  • 0 likes
  • 5 in conversation