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

I am trying to do a simple SQL join and keep getting this error message.  I'm can't figure what is wrong with my query that is causing the error.  Where is there a missing period?

 


proc sql;
	create table included_var as
		select a.NAME, b.field_name
		from varlist as a left join dictionary as b
		on a.NAME = b.field_name
	;
quit;

I get the following message in my log:

 

2003
2004
2005  proc sql;
2006      create table included_var as
2007          select a.NAME, b.field_name
2008          from varlist as a left join dictionary as b
                                                     --
                                                     78
ERROR 78-322: Expecting a '.'.

2009          on a.NAME = b.field_name
1     .
      -
      78
      200
1     .
      -
      78
      200
1     .
      -
      78
      76
ERROR 78-322: Expecting a '.'.

ERROR 200-322: The symbol is not recognized and will be ignored.

ERROR 76-322: Syntax error, statement will be ignored.

2010      ;
2011  quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I think the word DICTIONARY is reserved by SQL, and you can't use it as the name of a SAS data set.

--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

I think the word DICTIONARY is reserved by SQL, and you can't use it as the name of a SAS data set.

--
Paige Miller
mhoolsema
Calcite | Level 5

That was it!  I changed the name of the dataset to DATA_DICTIONARY and it worked fine.

PaigeMiller
Diamond | Level 26

@mhoolsema 

 

I haven't tried this, but I believe that WORK.DICTIONARY should work properly. 

--
Paige Miller
s_lassen
Meteorite | Level 14

More precisely, the SQL interpreter expects e.g. "dictionary.tables" or "dictionary.columns" when encountering the token "dictionary". You could probably also get away with referring to your dictionary table as "work.dictionary".

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 1855 views
  • 2 likes
  • 3 in conversation