Hey Calvin,
I'm not quite sure what you really need - I'm assuming you already read in the data - so lets call that data set input.
And you want to create a dataset with 6 rows per P=6 value in the input data set and they should contain one column which contains the values P, PP, PPP, PPPP, PPPPP (twice).
You can do this via a do-loop and using the output statement inside of the data step.
Example:
data work.result(drop=p i);
length x $5.;
*set work.input;
p = 6;
if p = 6 then do;
do i = 1 to p - 1;
x = cats(x,'P');
output;
end;
output;
end;
run;
I hope this helps.
Kind regards
Criptic
... View more