I am a novice SAS user and am trying to run a data step on a data set with 198 rows and 1611 columns. I don't think I am doing anything particularly elaborate in the data step, but it never completes it. I would really appreciate if someone could point out if/where there is a problem in my code. Thank you!
DATA merged2;
set merged;
Q1_rec_activity=.;
IF (.< PA <150) THEN Q1_rec_activity=0;
IF (. < PA >=150) THEN Q1_rec_activity=1;
IF (PA_Q3 == 8) THEN PA_Q3=0;
IF (PA_Q3 == 9) THEN PA_Q3=9999;
PA_calc_activity=.;
IF (. < PA_Q3 < 9999) and (. < PA_Q4) THEN PA_calc_activity=PA_Q4*PA_Q3;
IF (PA_Q3==9999) THEN PA_calc_activity=9999;
LABEL AGE='Age'
DEM_1='Birth Year'
DEM_2='Gender'
DEM_3='Marial status'
DEM_4='Hispanic/Latino'
DEM_5='Race'
DEM_7='Educational attainment'
DEM_8='Employment status'
DEM_10='Work schedule'
DEM_11='Coworkers'
DEM_12='Health insurance'
DEM_14='Income'
MODULE='Module'
TobScreen_1='Qualtrics 1 smoke cigarettes'
TOB_Q1='CHART tobacco module smoke cigarettes'
TobScreen_3='Qualtrics 1 smoke cigars, cigarillos, or filtered cigars'
TOB_Q3='CHART tobacco module smoke cigars, cigarillos, or filtered cigars'
Exercise_Time='Qualtrics 1 minutes of moderate activity'
PA_Q4='CHART PA module minutes of moderate activity'
RUN;
Because you're missing a semicolon at the end of your label statement, SAS sees RUN
as a part of the label statement. As such it never encounters a step boundary (a RUN, QUIT, DATA, or PROC statement, typically), and thus never actually compiles and runs your code.
As Reeza pointed out in comments, you also have some errors in your code. ==
is incorrect in SAS; single equal signs work for both equality and assignment. If you prefer to have two different symbols, you can use eq
for equality (though you still need to use =
in some option and parameter contexts).