I have this data, and I want to update a certain table using a macro
DATA WORK.t1;
LENGTH
POLICY_RK 8
POLICY_VERSION 8
TREATMENT_IND 8 ;
FORMAT
POLICY_RK BEST12.
POLICY_VERSION BEST12.
TREATMENT_IND BEST12. ;
INFORMAT
POLICY_RK BEST12.
POLICY_VERSION BEST12.
TREATMENT_IND BEST12. ;
INFILE DATALINES4
DLM='7F'x
MISSOVER
DSD ;
INPUT
POLICY_RK : BEST32.
POLICY_VERSION : BEST32.
TREATMENT_IND : BEST32. ;
DATALINES4;
105000002
114000005
123000007
132000001
141000007
1508
;;;;
I'm trying to run the below code:
%macro storno (pol_rk , pol_ver );
PROC SQL;
UPDATE t1
SET POLICY_VERSION=POLICY_VERSION*3.1113
where POLICY_RK=&pol_rk and policy_Version = &pol_ver;
QUIT;
%mend ;
data _null_;
set t1 ;
IF input(TREATMENT_IND,best12.) eq 1 THEN do;
call symputx("a",policy_rk);
call symputx("b",pol_ver);
end;
%storno(&a, &b);
%put a=&a;
%put b=&b;
run;
but get a warning message:
WARNING: Apparent symbolic reference A not resolved.
WARNING: Apparent symbolic reference B not resolved.
NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
19:21
NOTE: There were 6 observations read from the data set WORK.T1.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
NOTE: No rows were updated in WORK.T1.
What exactly am I doing wrong here....?
data _null_; ...; call execute('%storno(&a, &b);'); run;
-- voila! – samkart