Hi both, Thanks for the quick reply's. I recently changed laptops so my reply is a bit later than I hoped. Both of your answers helped solve the issues, thanks! There were two problems: 1. The dataset had the identifier formatted as a character variable with a length of 200. I changed that to the actual max. 2. The macro variable data contained more data than just kantoor=upcase("ZWOLLE"). The code now filters that macro variable to only contain the options used in the map. Below is my earlier code edited to a working version for other people interested. The added code is bold and underlined. I have also added a map as an example. Note that the formatting on that map is different from the formatting in the code below. *gemiddelde coordinaten per gemeente;
proc sql;
create table gem_cor as
select distinct t1.gemeente, t1.kantoor, avg(t1.x) as x, avg(t1.y) as y
from kaartgemeente as t1
group by t1.gemeente
order by kantoor, gemeente
;
quit;
data gem_cor2;
set gem_cor;
by kantoor gemeente;
if first.kantoor then nr=1;
else nr+1;
run;
proc sql noprint;
select catt('j=l "',nr,': ',gemeente,'"') into :gemeente separated by ' ' from gem_cor2
where kantoor=upcase("ZWOLLE"); quit;
*******************************************************
kaartcode ha
*******************************************************;
*variabelen die van toepassing zijn op de kaart;
FILENAME odsout "&outpath\kaart_ha";
goptions reset=all transparency device=png gsfname=odsout gsfmode=replace xpixels=1200 ypixels=1000 nofileonly;
ODS LISTING CLOSE;
ods listing;
*kleuren achtergrond van stedelijkheid bepalen;
pattern1 value=solid color='CXeff3ff'; ****super lichtblauw****;
pattern2 value=solid color='CXbdd7e7'; ****lichtblauw****;
pattern3 value=solid color='CX6baed6'; ****licht donkerblauw****;
pattern4 value=solid color='CX3182bd'; ****donkerblauw****;
pattern5 value=solid color='CX08519c'; ****super donkerblauw****;
data anno_labels;
set gem_cor2;
xsys='2';
ysys='2';
hsys='3';
when='a';
function='label';
size=1.1;
style = "'Albany AMT/bold'";
POSITION='5';
color='black';
text=cat(nr);
where kantoor=upcase("ZWOLLE");
;run;
proc gmap data=vv_geenbh10 map=kaartgemeente anno=anno_labels;
where regio="ZWOLLE";
id gemeente;
choro ratio/
coutline='CX002857'
legend=legend1
name="vv_ZWOLLE_ha"
statistic=first
Cdef='white'
;
legend1 origin=(3,20)pct mode=share
value=none shape=bar(.00001,.00001)pct label=(&gemeente);
run;
proc greplay igout=work.listing;
delete _ALL_;
proc greplay igout=work.gseg;
delete _ALL_;
ods listing close; This is my final map
... View more