BookmarkSubscribeRSS Feed
Barkat
Pyrite | Level 9

Could you provide a sample data, please.

Reeza
Super User

@Barkat given no data was provided that's a fair assumption and a good example of why sample data is important. It also helps avoid issue with types and formats, since if you use the automated data set builders suggested it uses the correct formats/types applied.

 

 

Barkat
Pyrite | Level 9

You may want to create a subset where wkvol=0. Then do proc means by brand name.

 

see below;

 

data hv;
infile datalines dsd dlm=',' ;
input name :$3. wkvol 5.;
datalines;
abc,0
def,023
pqr,125
xyz,200
jkl,0
jkl,0
jkl,280
run;


data hv1;

    set hv;

    where wkvol=0;

run;


proc sort data=hv1;

  by name;

run;

 

proc means data =hv1 n;

   var wkvol;

  by name;

run;

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!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 32 replies
  • 1775 views
  • 7 likes
  • 4 in conversation