BookmarkSubscribeRSS Feed
LucianTUM
Calcite | Level 5

I have a data set and I just want to do:

 

 

proc sql;
create table tmp_ivk as
select
KSOZ,
KNS,
KBTYP,
KLF,
count(*) as N 'N'
from db.grundgesamtheit&jahr1
group by KSOZ,
KNS,
KBTYP,
KLF
order by KSOZ,
KNS,
KBTYP,
KLF
;
quit;

 

but I get constantly the ERROR message for the second data base.

 

I also have an another data set and I did the same proc sql and it worked perfectly.

7 REPLIES 7
PaigeMiller
Diamond | Level 26

The error message is perfectly clear:

 

The following columns were not found in the contributing tables: KLF, KNS, KSOZ with proc sql

 

Since we don't have your data sets, you need to go into the datasets and determine what variables are there and what variables are missing and adjust your SQL accordingly.

 

--
Paige Miller
LucianTUM
Calcite | Level 5

Of course is the message clear. I had a look on the dataset and the mentioned variables were present.

Kurt_Bremser
Super User

When SAS tells you that a variable is not there, it isn't there, period.

Post the log of your code (complete step!), and the part of a proc contents output for all the contributing datasets that shows the variables.

art297
Opal | Level 21

You haven't shown what error message you're getting. That would definitely help to identify what problem your facing.

 

Looking at your code, a number of possibilities exist. Have you assigned the libname db?, Have you assigned the macro variable jahr1 AND is it part of the actual filename?, and Do all of those variables exist in your datafile?

 

Art, CEO, AnalystFinder.com

 

PaigeMiller
Diamond | Level 26

@LucianTUM wrote:

Of course is the message clear. I had a look on the dataset and the mentioned variables were present.


And yet you expect us to diagnose the problem, but you provide no information at all. We can't look at your datasets. You have all the information. As others have said, show us the SASLOG and PROC CONTENTS.

--
Paige Miller

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!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 7 replies
  • 3070 views
  • 1 like
  • 4 in conversation