Hi! First time poster, so hello everyone! I have a data step that I am having a very difficult time with. I have a data set that looks like this: Data Set: Number of Obs | Month 1 | Month 2 | Month 3 | Month 4 | Month 5 | Month 6 | ... | Month X| 4 | 50 | 25 | . | 10 | . | . | 5 | 50 | 25 | . | . | 10 | . | Desired Output: Number of Obs | Month 1 | Month 2 | Month 3 | Month 4 | Month 5 | Month 6 | ... | Month X| 4 | 50 | 25 | 0 | 10 | . | . | 5 | 50 | 25 | 0 | 0 | 10 | . | Basically, for every row: If the Month is less than the Number of Obs, I need to impute a 0 and if the Month is greater than the Number of Obs, I need to leave the value missing. So, in the first row, I need to drop in a 0 in Month 3 and leave Months 5 - Months X untouched. In Excel, I could put in a formula that says if (Month1 <= Number of Obs, Number, 0) and drag the formula but in SAS I cannot get this to work. Does anyone know how to do this? I am driving myself crazy over this, so any help would be appreciated. I can't hard code this all manually because I will have about a hundred months of columns. Thanks!!
... View more