If I have created an animation and it is working, how do I add the date for each image so it changes as the animation is performed? I am using BASE sas. Is there a way to do this in the code used for animating?
options papersize=('11 in', '7 in')
printerpath=gif
animation=start
animduration=0.7
animloop=yes
noanimoverlay
nodate;
ods printer file='C:/Users/lindsey/Documents/Gifs/all-appearance.gif';
Preferably as a footnote!
This is my code. Thanks for all of your help!
PROC IMPORT OUT=seven DATAFILE="C:/Users/lindsey/Documents/try7.csv" DBMS=CSV REPLACE;
GETNAMES=YES;
DATAROW=2;
guessingrows=all;
RUN;
proc IMPORT out=full_week DATAFILE="C:/Users/lindsey/Documents/full_week.csv" DBMS=CSV REPLACE;
GETNAMES=YES;
DATAROW=2;
guessingrows=all;
RUN;
%macro mapAnnually(dsn=, start=, end=);
%let start=%sysfunc(inputn(&start,date9.));
%let end=%sysfunc(inputn(&end,date9.));
%let dif=%sysfunc(intck(day,&start,&end));
%do i=0 %to &dif;
%let date=%sysfunc(intnx(day,&start,&i,b));
proc sgmap
plotdata=&dsn noautolegend;
openstreetmap;
title 'flu outbreaks' x=Longitude y=Latitude/ markerattrs=(size=7 color=CX003399
symbol=circlefilled) transparency=0.32;
run;
%end;
%mend mapAnnually;
ods html close;
/*--Create animation--*/
options papersize=('11 in', '7 in')
printerpath=gif
animation=start
animduration=0.7
animloop=yes
noanimoverlay
nodate;
ods printer file='C:/Users/lindsey/Documents/Gifs/NEW.gif';
ods graphics / width=10in height=6in imagefmt=GIF;
%mapAnnually(dsn=seven, start=01Jan2019, end = 07Jan2019);
options printerpath=gif animation=stop;
ods printer close;
ods html;
Whoops must have deleted it when I copied it over! So this worked, but the date is written as "21550" and then "21551.." any idea why?
I did this and the code barely ran and only gave me this note:
NOTE: The quoted string currently being processed has become more than 262 bytes long. You might have unbalanced quotation marks.
After restarting SAS, it worked! Thanks
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.