I see absolutely no connection between your "Portfolio" information and the example desired output;
This macro makes a data set named Want with the desired output though the 0 values come first. If you don't like that change the
do x&i=0 to 1 into do x&i = 1 to 0 by (-1);
%macro dummy(numPers);
data want;
retain case 0;
%do i=1 %to &numpers;
do x&i = 0 to 1;
%end;
case +1;
output;
%do i=1 %to &numpers;
end;
%end;
run;
%mend;
%dummy(5);
... View more