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.
The error message is perfectly clear:
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.
Of course is the message clear. I had a look on the dataset and the mentioned variables were present.
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.
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
Solved! Thank you!
@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.
I am just a beginner. But, thank you!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: