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
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;
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?
CFC_SAS_Communities_400x225.jpg
It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.
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.
Ready to level-up your skills? Choose your own adventure.