I'm trying to add in additional rows (of 0 values) to fill in for missing rows. For example, if I only have 5 rows of data (each row represents a month, so Jan-May), I want to add in 7 more rows (Jun-Dec) having value is 0.
Current data:
Goal:
Assuming col1, col2, and col3 can stay the same. What is the best way to automatically find how many rows are missing and then fill in the remaining rows with 0 values?
data temp;
infile datalines delimiter=',';
input col1 $ col2 $ col3 $ year month value;
datalines;
a,b,c,2024,1,15
a,b,c,2024,2,30
a,b,c,2024,3,45
a,b,c,2024,4,61
a,b,c,2024,5,77
;
run;
Thank you!
... View more