I run the following code
proc contents data=data.alverdens_lande out=al;
run;
proc means data=al;
var Migration;
run;
The first part comes out fine, tells me all about the variable of which there 6 and 2 categorical variables.
But then when i try to run mean of one of the numerical variables it cant find it.
Might be an easy fix?
I found the solution, it appears that simply writing out does not save the dataset as "al", so gotta figure out a way to do that 😄
I found the solution, it appears that simply writing out does not save the dataset as "al", so gotta figure out a way to do that 😄
@RazaTheLegend wrote:
I found the solution, it appears that simply writing out does not save the dataset as "al", so gotta figure out a way to do that 😄
Actually, that's not the problem (and it's not a solution either). AL is saved in your work library. Please see my other post for the solution.
Most of us will not download attached files, the proper way to provide data for us to use is: https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/
Whenever you have an error, show us the LOG for that data step or PROC (in this case PROC MEANS) so we can see the actual code used and the actual ERROR message and the location in the log where the error appears.
In this case, it seems pretty clear ... MIGRATION is not a variable in data set AL. Since AL is not your data, but rather the output from PROC CONTENTS, you cannot perform a PROC MEANS on AL. You want to perform a PROC MEANS on your actual data, which is in data set named data.alverdens_lande.
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: