%let name=etch-a-sketch; filename odsout '.'; /* I kinda got this idea from here ... http://blog.everydayscientist.com/?p=219 (but it was my idea to choose the Ohio Art stock price as the thing to plot :) */ %let sticker=OART; /* Read the most recent stock price data from the web */ filename dataurl url "https://www.google.com/finance/historical?output=csv%nrstr(&q)=&sticker"; data mydata; length sticker $8 stock $60; sticker="&sticker"; stock="&stock"; format date date7.; format open high low close dollar12.2; format volume comma12.0; infile dataurl dlm=',' firstobs=2; input date anydtdte. open high low close volume; run; proc sql noprint; select min(date) into :mindate from mydata; select max(date) into :maxdate from mydata; select max(date)-min(date) into :bydays from mydata; quit; run; goptions device=png; goptions xpixels=645 ypixels=525; goptions iback='etch-a-sketch.jpg' imagestyle=fit; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="Ohio Art (maker of etch-a-sketch) stock price") style=minimal; goptions ftitle="albany amt/bold" ftext="albany amt" ctext=gray22 gunit=pct htitle=2.75 htext=2.75; axis1 color=gray22 label=none major=(number=5) minor=none offset=(0,0); axis2 color=gray22 label=none order=(&mindate to &maxdate by &bydays) minor=none offset=(0,0); symbol1 color=gray22 width=2 interpol=steplj; title1 h=18pct " "; title2 h=14pct a=90 " "; title3 h=14pct a=-90 " "; title4 color=gray22 font="albany amt/bold" h=3.5 "Ohio Art (maker of etch-a-sketch) stock price"; footnote1 h=18pct " "; proc gplot data=mydata; plot close*date=1 / overlay noframe vaxis=axis1 haxis=axis2 des='' name="&name"; run; quit; ods html close; ods listing ;