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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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