BookmarkSubscribeRSS Feed
chrissowden
Obsidian | Level 7

x 'cd F:\SAS_Output';
/*--This program requires SAS 9.4--*/
%macro animate(start=, end=, incr=);
  %do year=&start %to &end %by &incr;

    proc sgplot data=DM_ noautolegend;
      
      footnote j=l 'Created using the SGPLOT Procedure';
      where yearnum=&year;
      
      bubble x=ethnic y=AGE size=race / group=country
        datalabel=SEX datalabelattrs=(size=12 weight=bold) dataskin=gloss
        bradiusmin=2 bradiusmax=50;
          inset "&year" / position=bottomright textattrs=(size=60 weight=bold color=lightgray);
      xaxis type=log offsetmin=0.05 offsetmax=0.08 logstyle=linear grid min=100 max=60000;
      yaxis offsetmin=0.05 offsetmax=0.05 grid min=30 max=90;
    run;

  %end;
%mend animate;


data DM_;
  set dscproj.dm;
  where age ne .;

    yearnum=input(substr(brthdtc,1,4),4.);
run;

/*--Create animation--*/
options papersize=('5 in', '3 in') printerpath=gif animation=start animduration=0.1 animloop=yes noanimoverlay;
ods printer file='DM.gif';

ods graphics / width=5in height=3in imagefmt=GIF;
%animate(start=1950, end=1984, incr=2);
%animate(start=1984, end=1950, incr=-2);

options printerpath=gif animation=stop;
ods printer close;

 

I am trying to output the gif to a certain folder and I get the following warning:

 

WARNING: RTF destination does not support GIF images. Using the
default static format.
WARNING: SIZE=RACE is invalid. The column has the wrong data
type.
WARNING: SIZE=RACE is invalid. The column has the wrong data
type.
WARNING: SIZE=RACE is invalid. The column has the wrong data
type.
WARNING: SIZE=RACE is invalid. The column has the wrong data
type.
 

 

1 REPLY 1
Reeza
Super User

Sounds like race may be a categorical/character variable whereas SIZE needs to be a numeric variable. And GIF is not supported for RTF. If you check the docs you can see what output format types are available:

 

https://documentation.sas.com/?docsetId=grstatproc&docsetTarget=p0kroq43yu0lspn16hk1u4c65lti.htm&doc...

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 1 reply
  • 733 views
  • 0 likes
  • 2 in conversation