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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 878 views
  • 0 likes
  • 3 in conversation