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.
Turns out it was because it was saved on a different server. Thanks for the input!
Post the log, so that we can see what happened.
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.
ERORR: File GRIDWORK.IMPORT.DATA does not exist.
Affected Code: LEFT JOIN GRIDWORK.IMPORT t2 ON (t1.FIrst_Name = t2. FIRST Name)
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.
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;
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.
I ran the code and Newdoc came up in the result
Try running a proc contents and post the output.
proc contents data=<data name>;
run;
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.
That was a typo on my part. After looking at it again they both say Gridwork
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.
Turns out it was because it was saved on a different server. Thanks for the input!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.