%let name=mall_build; /* Because of S1030356, I need to use this option in SAS 9.4, for older versions of SAS (on different platforms) to be able to read my datasets with CEDA. For example, my SAS/Intrnet job that runs on Unix. */ options extendobscounter=no; /* sas mall_build.sas sas mall_categories.sas sas mall_ods.sas sas mall_stores.sas */ /* Went here: http://www.shopcarytownecentermall.com/shop/carytowne.nsf/directory Right-clicked on mall map image, and Save-as cary_mall.png The png file is 900x628 */ /* Size (proportions) of your sas map png file */ %let xsize=900; %let ysize=628; /* This is the paper size - bigger than image, to accommodate titles, etc */ /* (this requires some trial&error to get the annotated image/map looking right */ goptions xpixels=915 ypixels=770; /* Size of invisible annotated pie/dot's on the grid */ %let piesize=.5; libname here '.'; data here.mall_map; idnum=1; x=0; y=0; output; x=symget('xsize'); y=0; output; x=symget('xsize'); y=symget('ysize'); output; x=0; y=symget('ysize'); output; run; /* Use category abbreviations - this will save typing later, and also make it easier to pass these in the sas/intrnet url's and the macro variables (otherwise, there could be problems with special characters such as ', &, *, etc). Now, when passing parameters to sas/intrnet, I can use the 'cat' and/or the 'spacenum', which are both simple/short text. */ data cats; input cat $ 1-5 category $ 7-37; datalines; bath Bathrooms acc Accessories apkid Apparel, Children's apuni Apparel, Family Unisex apmen Apparel, Men's apwom Apparel, Women's book Books, Cards & Gifts emv Electronics, Music & Video ent Entertainment, Toys & Games jewel Fine Jewelry food Food, Restaurant & Specialty hb Health & Beauty home Home Furnishings serv Professional Services shoes Shoes spec Specialties sport Sporting Goods & Apparel cell Wireless & Cellular Services dept Department Stores ; run; /* In this data set, you assign an x/y coordinate to each store. You get this location by mousing-over or clicking on the desired location in an image viewer/editor package (paint, unix xv, etc). This x/y is the location where the marker (such as a star) will be placed on the map. Each store needs a unique number (which I call 'spacenum'). Most of the space numbers are the numbers used on the original map. For the big stores without numbers, I use an abbreviation of the store name (which I arbitrarily picked). */ filename malldata 'mall.dat'; data mall_stores; infile malldata lrecl=100 pad; input x y spacenum $ 16-25 cat $ 27-34 store $ 36-80; y=&ysize-y; /* 'flip' the y-coordinate, since gmap's origin is bottom/left */ spacenum=lowcase(spacenum); run; /* Now, merge in the category names, based on the 'cat' category abbreviation */ proc sql; create table mall_stores as select * from mall_stores left join cats on mall_stores.cat = cats.cat; quit; run; /* During this last step, save it to permanent library (here.) */ data here.mall_stores; set mall_stores; length function $ 8 style color $ 12 html $ 1000 text $ 80; when='a'; xsys='2'; ysys='2'; hsys='3'; position='5'; /* a star character from the sas/graph 'marker' software font (first solid red, then outline black) */ /* color='red'; function='label'; size=4; style='marker'; text='V'; html=''; output; style='markere'; color='black'; html= 'title='||quote( trim(left(store)))|| ' '|| 'href='||quote( 'http://www.google.com/search?hl=en&q='||trim(left(store))||' '); output; */ /* seems the hover-areas are better with circles, than stars ... */ color='red'; function='pie'; rotate=360; size=1.5; style='psolid'; html=''; output; style='pempty'; color='black'; html= 'title='||quote( trim(left(store)))|| ' '|| 'href='||quote( 'http://www.google.com/search?hl=en&q='||trim(left(store))||' '); output; run; /* This is the annotated image of the mall picture */ data here.mall_pic; length function $ 8 style color $ 12 html $ 1000; xsys='2'; ysys='2'; hsys='3'; when='a'; function='move'; x=0; y=0; output; function='image'; x=&xsize; y=&ysize; imgpath='cary_map.png'; style='fit'; output; run; filename odsout '.'; goptions device=png; goptions cback=white; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="SAS Prototype - Virtual Cary Towne Center Mall Map") style=minimal; goptions ftitle="albany amt" ftext="albany amt" htitle=6pct htext=3pct; /* title f="albany amt/bold" h=18pt link="http://www.shopcarytownecentermall.com/mall/carytowne/carytowne.nsf/map?OpenForm" "Cary Towne Center"; */ proc sql; create table interest as select * from here.mall_stores; quit; run; pattern1 v=s c=white; proc gmap data=here.mall_map map=here.mall_map anno=here.mall_pic; id idnum; choro idnum / nolegend anno=interest coutline=white des='' name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;