SAS Employee

## Juletip #8 - Drawing a simple pyramid in SAS

Top down:

``````data _null_;
j=24;
do i=0 to 24 by 2;
b=repeat('*',i);
c=floor((j-i)/2);
put +c b;
end;
run;

*
***
*****
*******
*********
***********
*************
***************
*****************
*******************
*********************
***********************
*************************
``````

Bottom up:

``````data _null_;
j=24;
do i=24 to 0 by -2;
b=repeat('*',i);
c=floor((j-i)/2);
put +c b;
end;
run;

*************************
***********************
*********************
*******************
*****************
***************
*************
***********
*********
*******
*****
***
*
``````
1 ACCEPTED SOLUTION

Accepted Solutions
SAS Super FREQ

## Re: Juletip #8 - Drawing a simple pyramid in SAS

And don't forget this version of a SAS Christmas tree, drawn by the DATA step:

https://blogs.sas.com/content/iml/2011/12/16/a-sas-christmas-tree.html

SAS Super FREQ

## Re: Juletip #8 - Drawing a simple pyramid in SAS

And don't forget this version of a SAS Christmas tree, drawn by the DATA step:

https://blogs.sas.com/content/iml/2011/12/16/a-sas-christmas-tree.html

Discussion stats