03-07-2018 11:08 AM
I'm trying to get the sum of the Site_Approved2 and Date_Supplied3 by using the sum function or sum statement on SAS studio but nothing worked with me
please advise me on that.
here is my data
Obs Sites_Contracted site_number1 Site_Approved1 Date_Supplied312345678910111213141516171819202122232425262728293031323334353637
03-07-2018 11:12 AM
Neither, use a summary procedure such as MEANS, SUMMARY, UNIVARIATE, SQL or PROC TABULATE
See an example here:
03-07-2018 04:01 PM
I gonna create a report in another step
but I need to sum those variables to create a histogram
What makes you think that? Did you try creating a histogram with the raw data? And what does that have to do with my suggestion of using PROC MEANS/SUMMARY?
I would suggest you look at PROC UNIVARIATE and the HISTOGRAM statement within it. There's a lot of examples within the documentation that align with what you're trying to do.
03-07-2018 06:04 PM
I need to create a simple histogram like this after getting the total of each variable to insert it after the table that I created it by proc report
. So, I what I need to know is how to create a histogram from the total of those variable and how to insert it in proc report?
03-07-2018 06:05 PM
You can control what is included in the output and have no output as well. And PROC MEANS is how you would create that summary anyways.
The first example I demonstrated doesn't create any output because it used NOPRINT but did create the summary statistics. Did you try running that code? It' uses the data sets from SASHELP so you can run it directly in your session.
Bc Proc Univariate creates too many things that I don't need to include in my report
03-07-2018 07:10 PM
I'm bias about proc report for some reasons and I need to know how possible is create a histogram or chart there
Proc report doesn't do graphics. Proc report will create output datasets but you still need to send the data to a graphics procedure.
03-08-2018 11:28 AM
ods excel file='C:\_localdata\temp.xlsx' style=meadow options(sheet_interval='none'); title 'My Histogram'; proc sgplot data=sashelp.class; histogram height; run; title 'My Proc Report'; proc report data=sashelp.class; column sex age; define sex / group; define age / across; run; ods excel close;