BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mmagnuson
Quartz | Level 8

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.

1 ACCEPTED SOLUTION

Accepted Solutions
mmagnuson
Quartz | Level 8

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

View solution in original post

12 REPLIES 12
andreas_lds
Jade | Level 19

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

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.  

mmagnuson
Quartz | Level 8

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

 

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

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

mmagnuson
Quartz | Level 8

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;

ballardw
Super User

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.

 

mmagnuson
Quartz | Level 8

I ran the code and Newdoc came up in the result

Reeza
Super User

Try running a proc contents and post the output.

 

proc contents data=<data name>;

run;

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

mmagnuson
Quartz | Level 8

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

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

mmagnuson
Quartz | Level 8

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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