BookmarkSubscribeRSS Feed
Markanti
Calcite | Level 5
  1. Create a macro variable called “list” that represents the following variables when referenced: dbirwt nprevist wtgain; 
    1. Create a dataset called “four” from “main” keeping only those variables in this list.  Use the macro variable you created to do accomplish this. 
    2. Next find the means for these same variables using the macro variable.

Unfinished Code

*Lab 12 – Problem 1;

data

run;

proc

run;

I got correct for this.


%let list = dbirwt nprevist wtgain;

data four;
set lab.main;
keep &list;
run;

title "Using a Macro variable list";

proc means data=four mean;
var &list;
run;

 

but for 2nd problem I am getting error

  1. Use the dataset called “four” from the problem above and the macro variable call “list”, from the same problem
    1. Run a Proc Means for all these variables and save the results of this procedure into a new SAS data set called “Save” in the Lab library. 
  1. Add the option noprint right after data= lab.one;

Unfinished Code

*Lab 12 – Problem 2;

proc

run;

 my finished code is

title "Using a Macro variable list";

proc means data=lab.four noprint;
var &list;
run;

but I am getting error as

 ERROR: Neither the PRINT option nor a valid output statement has been given.
Where am I doing wrong??
 
1 REPLY 1

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 350 views
  • 0 likes
  • 2 in conversation