I took your code and used it to make Valentine's Day Cards. See an example at http://s614.photobucket.com/user/lrkappy/media/img0_zpslkcu1ofw.png.html

%macro makecard(for=Todd,from=Mom);
data Roses;
/* pick a random n and a random d*/
flower=0;
do k=1 to 100 until (flower=12);
do i=1 to 100 until (done=1);
u=rand("Uniform");
n = 4 + floor( (1+7-4)*u );
u=rand("Uniform");
d= ceil(9*u);
if (n=4 and d in(1,3,5,7,9))
or (n=5 and d ne 5)
or (n=6 and d in (1,5,7,8))
or (n=7 and d ne 7) then do;
flower=flower+1;
done=1;
k = n / d;
/* draw the rose r=cos(n/d * theta) */
group = mod(n+d, 2);
/* optional: use for color */
do theta = 0 to 2*lcm(n,d)*constant("pi") by 0.1;
r = cos(k * theta); /* generalized rose */
x = r*cos(theta); /* convert to Euclidean coords */
y = r*sin(theta);
if flower <= 5 then do;
cx=2*flower+1; cy=9;end;

else if 6<= flower<=9 then do;
cx=(2*flower-8); cy=10.5; end;
else if 10<= flower<=12 then do;
cx=(2*flower-15);
cy=12; end;
x=x+cx; y=y+cy;
group=flower;
output;
group=flower-20;
x=cx;y=cy; output;
x=7;y=3; output;
end;
end;
end;

end;
/*bow*/
do theta = constant("pi")*7.5/12 to constant("pi")*28.5/12 by 0.01;
r = cos(2 * (theta)); /* rose */
x = r*cos(theta); /* convert to Euclidean coords */
y = r*sin(theta);
group=100;
if y<abs(x) then do;
x=x+7; y=y+3;
output; end;
end;
run;

proc sort data=roses;
by group;

title1 "Happy Valentines Day &for" color=rose;;
title2 "A Dozen Random Polar Roses for You" color=rose;

proc sgplot data=Roses aspect=1 noautolegend
noborder nowall;
styleattrs datacontrastcolors=
(
green green green green
green green green green
green green green green
red bippk red purple bippk
blue purple bippk red purple blue red
crimson
) datalinepatterns=(1);
series x=x y=y /group=group ;
xaxis min=0 max=15 display=none;
yaxis min=0 max=15 display=none;
footnote "Lots of Love, &from";
footnote2 " ";
footnote3 " ";
footnote4 " ";
footnote5 " Polar Roses: r = cos(n/d theta)";
footnote6 " Generated with the SAS System 9.4";
run;
%mend;

%makecard(for=Anya,from=Mom);
%makecard(for=Stephen,from=Mom);