Hi:
Which file are you sending to PROC MEANS?? For example, let's say that you have this scenario:
File A = File without PROGRAM_PARTICIPATION variable
File B = File -with- PROGRAM_PARTICIPATION variable
If you send File A to PROC MEANS, then program_participation will not be available for PROC MEANS to do analysis. If your ENTIRE program is shown below, then there is a disconnect between what you want and what you're doing.
Also, Proc Means does not support an IF statement...so if you were trying to put your IF statement inside PROC MEANS syntax, then you should find that your LOG file has some error messages. A general program flow would be something like this:
[pre]
Data File_B;
set File_A; /* read in File_A to calc new variable */
if v2509 = 1 or v2510 = 1 or v2511 = 1 or v2512 = 1 or v2513 = 1 or v2514 = 1 or v2515 = 1 or v2516 = 1 then program_participation = 1;
if v2509 = 0 or v2510 = 0 or v2511 = 0 or v2512 = 0 or v2513 = 0 or v2514 = 0 or v2515 = 0 or v2516 = 0 then program_participation = 0;
run;
proc freq data=File_B;
tables program_participation;
run;
proc means data=File_B;
class program_participation;
var numvar;
run;
[/pre]
I also wonder about your logic...what about an observation where
v2509 = 1 and v2510 = 0 and v2511 = 0...meaning 1 of the vars is 1 and the rest are 0 .... in that case, would program_participation be 1 or 0?? With your logic, if program_participation is set to 1 in the first IF statement (because v2509=1), if any of the other variables are 0, then program_participation will be reset to 0 with the second IF statement. Is this what you want to have happen?
cynthia