BookmarkSubscribeRSS Feed
Shrutibhatnagar
Obsidian | Level 7
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 proc sql;
74 select product_id ,count(product_id)
75 from class1.mismatches1
76 group by class1.product_id
77 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;
 
 

 

9 REPLIES 9
PaigeMiller
Diamond | Level 26

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

 

--
Paige Miller
Shrutibhatnagar
Obsidian | Level 7

Hello,

I have tried with both of them ,yes i have used class1 ref in libname before. 

Shrutibhatnagar
Obsidian | Level 7
says no source no syntax check
PaigeMiller
Diamond | Level 26

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).

--
Paige Miller
Shrutibhatnagar
Obsidian | Level 7
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 proc sql;
74 select product_id ,count(product_id)
75 from class1.mismatches1
76 group by class1.product_id
77 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;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.06 seconds
cpu time 0.03 seconds
 
79
80 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
92
 
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
Shrutibhatnagar
Obsidian | Level 7
 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 libname class1 '/folders/myfolders/mysas';
NOTE: Libref CLASS1 refers to the same physical library as CLASS3.
NOTE: Libref CLASS1 was successfully assigned as follows:
Engine: V9
Physical Name: /folders/myfolders/mysas
74 proc import datafile='/folders/myfolders/mysas/smb.csv'
75 dbms=csv out=class1.smb replace;
76
77
78 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
WORK.PARMS.PARMS.SLIST.
99999 rows created in CLASS1.SMB from /folders/myfolders/mysas/smb.csv.
 
 
 
1353
 
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
ballardw
Super User

@Shrutibhatnagar wrote:
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 proc sql;
74 select product_id ,count(product_id)
75 from class1.mismatches1
76 group by class1.product_id
77 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.

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 9 replies
  • 6217 views
  • 0 likes
  • 3 in conversation