Я пытаюсь определить случаи и элементы управления в моем наборе данных, используя опубликованную программу SAS. Я новичок в SAS и макросах надеюсь, что кто-нибудь сможет помочь в устранении неполадок. Я получаю следующую ошибку
ВНИМАНИЕ: Кажущаяся символьная ссылка VCNT не разрешена.
Вот мой код
data aggregate_all_11;
set aggregate_all_10 (rename=(age1=age));
run;
%LET AGERANGE=1;
%LET RATIO=5;
DATA CASES CONTROLS;
SET aggregate_all_11;
IF abuser = 1 THEN OUTPUT CASES;
ELSE OUTPUT CONTROLS;
PROC FREQ NOPRINT DATA=CASES;
TABLES age*gender/OUT=CASEOUT;
%MACRO SAMPLE(V_AGE,V_SEX,V_COUNT);
DATA QUALIFY1;
SET CONTROLS;
WHERE (&V_AGE-&AGERANGE <=AGE<=&V_AGE+&AGERANGE)
AND (GENDER = '&V_SEX');
CASE_AGE=&V_AGE;
CASE_SEX='&V_SEX';
SEED=RANUNI(0);
PROC SORT; BY SEED;
DATA QUALIFY2;
SET QUALIFY1 NOBS=TOTOBS;
IF _N_<=&V_COUNT*&RATIO;
IF &VCNT*&RATIO <= TOTOBS THEN TAG ='YES'; ELSE TAG ='NO';
PROC APPEND BASE=MATCHES DATA=QUALIFY2;
PROC SORT DATA=QUALIFY2 OUT=TEMP1(KEEP=UNIQUEID); BY UNIQUEID;
PROC SORT DATA=CONTROL OUT=TEMP2;BY UNIQUEID;
DATA CONTROL;
MERGE TEMP1(IN=IN1) TEMP2(IN=IN2);
BY UNIQUEID; IF IN2 AND NOT IN1;
%MEND SAMPLE;
DATA _NULL_; SET CASEOUT;
CALL EXECUTE('%SAMPLE('||AGE||','||GENDER||','||COUNT||')');
RUN;
LOG
NOTE: Line generated by the CALL EXECUTE routine.
1 +
DATA QUALIFY2; SET QUALIFY1 NOBS=TOTOBS; IF _N_<=5*5; IF &VCNT*5 <= TOTOBS THEN TAG ='YES'; ELSE
_
22
WARNING: Apparent symbolic reference VCNT not resolved.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
a missing value, INPUT, PUT.
2 + TAG ='NO';
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.QUALIFY2 may be incomplete. When this step was stopped there were 0 observations and 46 variables.
WARNING: Data set WORK.QUALIFY2 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):