Actually here is a small example of something that's no longer working when I re-run it. In this example, the variable "employed" at first was coded correctly and the surveyfreq procedure ran correctly. Then when I re-ran this piece of code, all the observations for "employed" suddenly changed to "." so the surveyfreq procedure no longer was useful. ____ /*separating out employment variable Q60 into separate variables for each type of employment*/ DATA work.abcdata; SET work.abchmvdata; IF Q60_clean = 1 THEN employed = 1; ELSE IF Q60_clean IN (2:7) THEN employed = 0; ELSE employed = . ; IF Q60_clean = 2 THEN outofwork1yrplus = 1; ELSE IF Q60_clean IN (1,3:7) THEN outofwork1yrplus = 0; ELSE outofwork1yrplus = . ; IF Q60_clean = 3 THEN outofwork1yrless = 1; ELSE IF Q60_clean IN (1:2, 4:7) THEN outofwork1yrless = 0; ELSE outofwork1yrless = . ; IF Q60_clean = 4 THEN homemaker = 1; ELSE IF Q60_clean IN (1:3, 5:7) THEN homemaker = 0; ELSE homemaker = . ; IF Q60_clean = 5 THEN student = 1; ELSE IF Q60_clean IN (1:4, 6:7) THEN student = 0; ELSE student = .; IF Q60_clean = 6 THEN retired = 1; ELSE IF Q60_clean IN (1:5, 7) THEN retired = 0 ; ELSE retired = . ; IF Q60_clean = 7 THEN unabletowork = 1; ELSE IF Q60_clean IN (1:6) THEN unabletowork = 0; ELSE unabletowork = . ; RUN; PROC SURVEYFREQ data=work.abcdata; STRATA weightstrata; TABLES Q60_Clean employed; weight baseweight; RUN;
... View more