06-23-2015 03:32 AM
I just need a little bit help with some macro coding.
I have a random sample of 30 observations from the full dataset of 21000. The first code you see is where i create a macro variable for each of the 30 observations from the sample.
proc sql noprint;
The second code is posted below. The point of this loop macro variable is to create 30 unique datasets by using the values from the macro variables X1-X30.
The problem arises in the "where" statement. For the first loop i want the where statement to look like : X=X1, for the second loop i want it to look like X=X2 and so on.
%do r=1 %to &n;
create table Company&r as
where X=&X&r; /* This code right here doesnt work. By inserting n=30 i thought the loop would automically assume X=X1, X=X2, X=3 and so on*/
Any tips or help would be greatly appreciated.
Need further help from the community? Please ask a new question.