BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Sandeep77
Lapis Lazuli | Level 10

Hi Expert,

I am trying  to find some information from the database and I feel that I have correctly written the code but I am getting error as following columns were not found in the contributing tables. I checked the columns in telephonenumbers database and these columns are available in the telephonenumber tables. Please suggest what is the error.

proc sql;
create table phone_numbers as
select  
tnkey as debt_code,
tnphone,
tntype 
from p2scflow.telephonenumbers
where tntype = 'D';
quit;

error:

29         proc sql;
30         create table phone_numbers as
31         select  tnkey as debt_code,
32         tnphone,
33         tntype 
34         from p2scflow.telephonenumbers
35         where tntype = 'D';
ERROR: The following columns were not found in the contributing tables: 'tntype 'n, ' tnkey'n.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
36         quit;
1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @Sandeep77,

 

The error message indicates that your code contains unwanted characters that only look like blanks: one preceding "tnkey" (note the double space between that name and the SELECT keyword) and one following "tntype". Delete these characters in your code and retype ordinary blanks where necessary.

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hi @Sandeep77,

 

The error message indicates that your code contains unwanted characters that only look like blanks: one preceding "tnkey" (note the double space between that name and the SELECT keyword) and one following "tntype". Delete these characters in your code and retype ordinary blanks where necessary.

Sandeep77
Lapis Lazuli | Level 10
Thank you!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 616 views
  • 2 likes
  • 2 in conversation