%macro ClassBubbleAnim(start=, end=, steps=); %do i=0 %to &steps-1; data class; set sashelp.class; frac=&start + &i*(&end - &start)/&steps; height=height*frac; weight=weight*frac; age=age*frac; run; proc sgplot data=class; title 'Weight and Age by Height over time'; footnote j=l 'Using gif animation with SGPLOT procedure'; bubble x=height y=weight size=age / group=sex dataskin=sheen; inset "Step &i of &Steps" / textattrs=(size=12) position=bottomright; keylegend / location=inside position=topleft; xaxis min=0 max=75; yaxis min=0 max=145; run; %end; %mend ClassBubbleAnim; options papersize=('4 in', '3 in') printerpath=gif animation=start animduration=0.05 animloop=yes noanimoverlay; ods printer file='ClassBubbleAnim.gif'; ods graphics / width=4in height=3in imagefmt=GIF; %ClassBubbleAnim(start=0.5, end=1.0, steps=50); %ClassBubbleAnim(start=1.0, end=0.5, steps=50); options printerpath=gif animation=stop; ods printer close;