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?

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