Hi,
I want to create n new variables (within a DataSet) where n is the value of a variable nbr.
The following code doesn't work, but may illustrate the problem:
data temp;
set temp;
by origin destin day std;
where nbr ne 1;
if last.origin or last.destin or last.day then do;
call symput ('nbr', compress(NBR));
do J = 1 to NBR;
call symput ('j', compress(J));
call symput ('name', TEST_||compress(J));
resolve('&name.') = lag||resolve('&j.')(std);
end;
output;
end;
run;
Is there a way you can use dataset values within the names of new variables?
... View more