Data visualization with SAS programming

GMAP - Fragmenting Map, problems with GREMOVE

Accepted Solution Solved
Reply
Contributor
Posts: 26
Accepted Solution

GMAP - Fragmenting Map, problems with GREMOVE

So I want to remove an internal border in my map data set, which I imported from a shape file. It is based on the German zip code and I want to now visualize some insurance zones on top of it. These zones are intermixed with each other, but they never overlap. After I joined my zones to the imported data set everything seems to be fine, everything as a zone and the number of entries doesn't change. Then I use PROC SORT to sort the new joined data set by the insurance zones - again everything seems to be fine. Then in my last step I use PROC GREMOVE and this where things go downhill, the number of entries reduces by about 200.000 and I have no idea why. I am posting the code below with it (hoping my formatting isn't to awful this is my first time posting). Thanks in advance for any help you can give me. &DETAIL is a macro variable that includes the specific insurance zone which the user can specify.

/*This dummy is need because the zones are always in a zip code range*/

DATA PLZ_DUMMY(KEEP=plz);

  x=0;

  DO WHILE(x LE 99999);

    plz=PUT(x,z5.);

    OUTPUT;

    x=x+1;

  END;

  RUN;

  /*Here I join my dummy table with the table that includes the insurance zones*/

  PROC SQL;

  CREATE TABLE GDV_ZONEN AS

  SELECT  a.plz, b.&DETAIL

  FROM PLZ_DUMMY a

  LEFT JOIN kwh_dim.vgv_gdv_tarifzonen b

  ON a.plz BETWEEN b.plz_von and b.plz_bis;

  QUIT;

  /*Here I Left Join my imported data set which is based on the zip code with the data set which includes the zones*/

  PROC SQL;

  CREATE TABLE GDV_ZONEN_KOR AS

  SELECT kb.*, gz.&DETAIL

  FROM KARTEN_BASIS kb

  LEFT JOIN GDV_ZONEN gz

  ON kb.plz = gz.plz;

  QUIT;

  /*Sorting*/

  PROC SORT DATA=GDV_ZONEN_KOR OUT=GDV_ZONEN_SORT;

  BY &DETAIL;

  RUN;

  /*Removing the old ID and setting the zone as the new ID - I think*/

  PROC GREMOVE DATA=GDV_ZONEN_SORT OUT=MAP_DATA;

  ID ID;

  BY &DETAIL;

  RUN;


Accepted Solutions
Solution
‎07-08-2015 12:07 PM
SAS Employee
Posts: 170

Re: GMAP - Fragmenting Map, problems with GREMOVE

I can't tell what you are doing without the data, but the following example seems to be the same thing that you are trying to do:  http://support.sas.com/documentation/cdl/en/graphref/67288/HTML/default/viewer.htm#p0zr4d6x9xv72tn13...

View solution in original post


All Replies
Solution
‎07-08-2015 12:07 PM
SAS Employee
Posts: 170

Re: GMAP - Fragmenting Map, problems with GREMOVE

I can't tell what you are doing without the data, but the following example seems to be the same thing that you are trying to do:  http://support.sas.com/documentation/cdl/en/graphref/67288/HTML/default/viewer.htm#p0zr4d6x9xv72tn13...

Contributor
Posts: 26

Re: GMAP - Fragmenting Map, problems with GREMOVE

Thanks, it seems that when I use MERGE I have no problems with the fragmentation so something most have been of with my JOIN. Thanks for the response.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 356 views
  • 0 likes
  • 2 in conversation