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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—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
  • 3684 views
  • 7 likes
  • 4 in conversation