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
column FT TERM_DESC work let2015 ;
define TERM_DESC/ ACROSS ;
if TERM_DESC = "Fall 2016" THEN let2015 = work.sum ;
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.
Per the topic here:
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;