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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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