Dear sas user community, I develop codes to sum year to date data, the code as follows: proc sql; create table ytd_data as select location, qtr as period, /* qtr in Q1,Q2,Q3,Q4 */ sum(volume) as volume, sum(var0) as var0 from (quarterly data) group by location , qtr UNION select location, YTD as period, sum(volume) as volume, sum(var0) as var0 from (quarterly data) group by location ; Quit; As a result, I get the output : location period volume var0 A Q1 10 5 (not exist this line if missing) A Q2 10 8 A Q3 20 7 A Q4 50 9 A YTD 90 29 Then I transpose it to horizontal line : Location YTD YTD_var0 Q1 Q1_var0 ... A 90 29 10 5 Now if I have missing data on quarter (for example Q1) , I assign "." to it such as Location YTD YTD_var0 Q1 Q1_var0 A 90 29 . . other quarters values How can I code the missing quarter values for all locations (about 80) ? I appreciate your support. Regards, WT196838
... View more