my purpose is pretty simple. Just want to give some values to datasets. There are 2 steps. First, is read the values into macro variables. Second, pass the macro variables to the dataset. The codes are:
First, create macro variables.
proc sql;
select procdate, prim,side,orgnname,orgnid,OrgnStTe into :procdate, :prim, :side, :orgnname, :orgnid, :OrgnStTe from ours
where objid=783125;
quit;
This step works well. Then pass the values.
data test;
set m1;
if id=184 then DO;
objid=783125;procdate=&procdate.;prim=&prim.;side=&side.;orgnname=&orgnname.;orgnid=&orgnid.;OrgnStTe=&OrgnStTe.;
END;
run;
For this step, the error is about orgnname. Not quite sure about the error. I tried %bquote(&orgnname.) and %str(&orgnname.). Both were not working.
NOTE: Line generated by the macro variable "ORGNNAME". 1 CALVARY JOHN JAMES MEMORIAL HOSPITAL ---- 388 76 ERROR 388-185: Expecting an arithmetic operator.
ERROR 76-322: Syntax error, statement will be ignored.