BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JKCho
Pyrite | Level 9
proc sql;
create table Rstd as 
 select cusip and year,std(dailyr) as with_in_std 
  from rvol
   group by cusip, year;
quit;

I think this time I am even closer to the right answer than before. feels like I am learnings SAS more.

Yes. I know I do not have to put and year after cusip but simply do not know how to have grouped std...

I did both select cusip,std(dailyr) as with_in_std and select year,std(dailyr) as with_in_std

and it worked so good and saw groups std eight by cusip or year.

BUT... I want grouping using both year and cusip simultaneously.

 

I appreciate your help very much!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
proc sql;
create table Rstd as
select cusip, year,std(dailyr) as with_in_std
from rvol
group by cusip, year;
quit;

View solution in original post

1 REPLY 1
Reeza
Super User
proc sql;
create table Rstd as
select cusip, year,std(dailyr) as with_in_std
from rvol
group by cusip, year;
quit;

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 769 views
  • 1 like
  • 2 in conversation