I'm wondering how to replace missing values in STATA for certain rows only (as noted above).

I have a long column with 842 cells. The first 160 should be 1, and the rest should be 0. However, I have missing values scattered throughout 1-842. How can I replace the missing values in 1:160 with 1, and the missing values in 161:842 with 0?