BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
RazaTheLegend
Calcite | Level 5

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
RazaTheLegend
Calcite | Level 5

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 😄

View solution in original post

3 REPLIES 3
RazaTheLegend
Calcite | Level 5

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 😄

PaigeMiller
Diamond | Level 26

@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.

--
Paige Miller
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 3 replies
  • 501 views
  • 2 likes
  • 2 in conversation