RosettaCodeData/Task/Loops-For/SAS/loops-for.sas

22 lines
312 B
SAS
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
data _null_;
length a $5;
do n=1 to 5;
a="*";
do i=2 to n;
a=trim(a) !! "*";
end;
put a;
end;
run;
2016-12-05 22:15:40 +01:00
/* Possible without the inner loop. Notice TRIM is replaced with STRIP,
otherwise there is a blank space on the left */
data _null_;
length a $5;
do n=1 to 5;
a=strip(a) !! "*";
put a;
end;
run;