Hi,
I am trying to summarize the data (sample data attached) in the attached sample template with proc report. However I am getting error message after I write this code
proc report data=sample
out=lat nowd;
column FT TERM_DESC work let2015 ;
define FT/group;
define TERM_DESC/ ACROSS ;
compute let2015;
if TERM_DESC = "Fall 2016" THEN let2015 = work.sum ;
endcomp;
quit;
The error message states - Variable TERM_DESC is uninitialized.
Will appreciate some guidance in moving ahead and any tips to overcome any future hurdles in the report.
Thanking you!
Per the topic here:
https://communities.sas.com/t5/Base-SAS-Programming/template/m-p/486193/highlight/false#M126458
Use a datastep and transposes before proc report to manipulate your data, then use a simple proc report to output the data. This is far simpler and more effective method than using a reporting procedure to manipulate data.
Per the topic here:
https://communities.sas.com/t5/Base-SAS-Programming/template/m-p/486193/highlight/false#M126458
Use a datastep and transposes before proc report to manipulate your data, then use a simple proc report to output the data. This is far simpler and more effective method than using a reporting procedure to manipulate data.
Without seeing your data I have no idea. You are effectively doing that in the proc report though, so just a matter of doing it in a datastep. sum() function does not work the way you think, it works horizontally, so sum(work) will be the same as work, same number of observations. You would need to retain it across rows:
data sad; set...; retain newvar nvar; if...; run;
Thank you for your reply. I have attached the Dataset and the reporting template here. Can you please advice the most efficient way to go about this.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: