BookmarkSubscribeRSS Feed
Yashponde
Calcite | Level 5

 

Hi guys,

I have created a table containing sum of a few variables. I wanted to plot the sum of these variables on a graph, preferably a histogram.

This would help me understand the different variables on a graph. 

 

proc sql;
create table t4 as
select sum(Hardplastics) as Hard_Plastics, sum(Softplastics) as Soft_Plastics, sum(plasticlines) as Plastic_Lines, sum(styrofoam) as Styrofoam, sum(pellets) as Pellets, sum(driftingwood) as Drifting_Wood, sum(pumice) as Pumice
from assign2.survey;
run;

 

Intended Output

Capture2.PNG

2 REPLIES 2
Ksharp
Super User
proc sql;
create table have as
select 'age' as name length=20,sum(age) as sum from sashelp.class
union
select 'weight' as name length=20,sum(weight) as sum from sashelp.class
union
select 'height' as name length=20,sum(height) as sum from sashelp.class;
quit;
proc sgplot data=have;
vbar name / response=sum nostatlabel;
yaxis display=(noline) grid;
run;
ballardw
Super User

It appears that you are in the same class as the author of https://communities.sas.com/t5/SAS-Programming/Renaming-variables-then-assign-a-numeric-to-the-renam...

 

may be it is time to form a study group?

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 2 replies
  • 836 views
  • 0 likes
  • 3 in conversation