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;

SAS Innovate 2025: Call for Content

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2091 views
  • 7 likes
  • 4 in conversation