I want the following macro to loop through a series of invoices INV06 and choose them.
%macro overall;
data lIB.Drug33 (keep= DRUG_CDE1 S_P_NAME PROVIDER SRVC_PROV_NPI PRSC_PRV FROM_DTE BIRTH STATUS RECIP TENT_PAY SERV_FEE QTY_DISP);
%let status = '1';
%let drug_cde1 = 33;
if status = &status
and drug_cde1 =&drug_cde1 then
set
%do i = 1 %to 2; /*where 1 is the first number and 7 is the last*/
p_claim.Inv06_2010_&i
%end;
;
run;
%mend;
%overall;
I am trying to limit the pull to those with a status of '1' and a drug_cde of 33. However when I run the program I get the following errors;
ERROR: Variable drug_cde1 has been defined as both character and numeric.
ERROR: File WORK.IF.DATA does not exist.
ERROR: File WORK.STATUS.DATA does not exist.
ERROR: The value 1 is not a valid SAS name.
NOTE: Line generated by the macro variable "I".
1 p_claim.Inv06_2010_2
--------------------
557
ERROR: DATA STEP Component Object failure. Aborted during the COMPILATION phase.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :,
;, END, INDSNAME, KEY, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.
ERROR 200-322: The symbol is not recognized and will be ignored.
ERROR 557-185: Variable p_claim is not an object.