BookmarkSubscribeRSS Feed
avikam
Calcite | Level 5

this is my macro:

 

 

%macro ib;
%DO II=1 %to 175;
data aaⅈ
set a1;

if h1=&ii or h2=ⅈ


proc means;

 

 

%end;
%mend ib;

%ib

avikam
Calcite | Level 5

not yet.

 

I wiil bs"d.

 

I wrote Macro to solve the problem.

Tom
Super User Tom
Super User

So it sounds like you first should convert your data from wide to tall format and then you can calculate the mean.

data tall ;
  set have ;
  h=h1; mx=mx1; output;
  h=h2; mx=mx2; output;
  keep h mx ;
run;

proc means data=tall ;
  where h in (101 175);
  class h ;
  var mx;
run;
  

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
  • 17 replies
  • 1703 views
  • 1 like
  • 7 in conversation