If you have previously defined CLASS1 in a LIBNAME statement, then you want
group by mismatches1.product_id
or, since there is only one data set mentioned in the FROM clause, you could also use
group by product_id
Hello,
I have tried with both of them ,yes i have used class1 ref in libname before.
I have tried with both of them ,yes i have used class1 ref in libname before.
Show us the entire SAS log of what you have tried. Click on the {i} icon and paste the log into the window that appears (do not show us the log any other way).
So you have not defined CLASS1 in a LIBNAME statement? There is no LIBNAME in your log.
When you show us the log, you need to click on the {i} and paste the log into that window. Do not show us logs any other way.
Hi, we are trying to help you, but you have to help us. Logs must be pasted into the window that appears when you click on the {i} icon.
@Shrutibhatnagar wrote:
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;7273 proc sql;74 select product_id ,count(product_id)75 from class1.mismatches176 group by class1.product_id77 having count(product_id) >1 ;ERROR: Unresolved reference to table/correlation name class1.NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.78 quit;
Except in the FROM clause a reference like ABC.PDQ means that ABC is a data set reference or alias and PDQ is the variable named PDQ in the data set ABC.
So your statement
76 group by class1.product_id
is attempting to reference a dataset named class1 that has not been defined. If you want to use the variable Product_id that comes from the data set class1.mismatches1 then only use
group by product_id
You can create an alias to data set by
from library.dataset <as> abc
the as is optional but I normally use it to keep the intent clearer.
Then to reference a variable in the dataset library.dataset you use abc.varname.
This is mostly import when two or more data sets are used in a single proc sql statement and especially when two or more sets have a same named variable to reference which data set you want to contribute the value.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.