Hello, I am trying to prepopulate a table with some values to make sure all combinations are accounted for in the final data set . I tested a simple PROC SQL insert step: PROC SQL;
INSERT INTO work.Temp
Set site= 'WBK'
,DurationCat = put(1+( 1*.25),5.2)
,DurationCount=0
;quit; to make sure I had the right syntax for the insert, and it worked as expected. Now what I want is to pass the Site name in through a Macro, and then do a loop where the 1*.25 is actually {0*.25,1*.25... ...10*.25,11*.25} this way I get an entry for each site with a duration category of 1 to 3.75 moving by 0.25 So I modify the code to a macro : %Macro StartTable (whichsite);
PROC SQL;
%do k = 0 %to 11;
INSERT INTO work.Temp
Set site= &whichsite.
,DurationCat = put(1+( &k.*.25),5.2)
,DurationCount=0
%END
;quit;
%mend StartTable; which I call with %StartTable(whichsite='WBK');
%StartTable(whichsite='WCK');
%StartTable(whichsite='WDK'); However I am getting this error: ERROR 22-322: Syntax error, expecting one of the following: ;, !!, *, **, +, ',', -, /, SET, ||. I am sure I am doing something dumb and missing a simple syntax error, but for the life of me I can't figure it out. Any help would be appreciated.
... View more