*
* *
* * *
* * * *
* * * * *
data _null_;
do n=0 to 4;
a=repeat('* ', n);
put a;
end;
run;
prints
* * * * * * * * * * * * * * *
data _null_;
do n=0 to 4;
a=repeat('* ', n);
put a;
end;
run;
prints
* * * * * * * * * * * * * * *
Thank You
Brilliant Code
Yes.
data _null_;
file print;
length text $100;
do i = 1 to 5;
text = catx(' ',text,'*');
put text;
end;
run;
Thank You sir
very impressed your outstanding coding skills
Just have some fun.
data _null_;
do i=1 to 5;
do j=1 to i;
put '* ' @;
end;
put;
end;
run;
And another approach:
proc format library=work; value stars 1='*' 2='* *' 3='* * *' 4='* * * *' 5='* * * * *' ; data _null_; do i = 1 to 5; put i stars.; end; run;
Though harder to maintain if you need a 20 row lower triangle.
Thank You sir
Thank Your
what if right angle triangle
Do a little thinking for yourself: how can you fill a character variable from the rear?
Sure. Not a big deal .
data _null_;
do i=5 to 1 by -1;
do j=5 to i by -1;
put @(2*j) '* ' @;
end;
put;
end;
run;
Thank You Ksharp
Your are really sharp ![]()
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.