Date: Wed, 16 Aug 2006 16:28:26 -0700
Reply-To: ChrisW75 <9Squirrels@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: ChrisW75 <9Squirrels@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: SAS Map for Canada with postal code info
In-Reply-To: <1155748225.979768.287020@p79g2000cwp.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"
There's no postcode info for Canada as far as I'm aware, however they
do have country maps available for download on the SAS Support site.
Strangely, I actually created a map dataset from MapInfo data the other
day for Australia (not postcode data, but the state maps).
The code I used is below. One thing to note is that this produces a map
of each state individually. If you want all shown together, you need
to pring all the datafiles together first, then run GPROJECT on all the
data together.
One GPROJECT you'll need to look up the options, mine is set up to
use Longitude and Latitude in degrees, and we're on the other side of
the world from you. I believe that over there you may not need to use
the EASTLONG option. The data is in the MapInfo interchange format
(.mif file), so if oyu have the info in MapInfo, you should be
laughing.
:-
filename ACT 'P:\Datasets\Boundary2001\STE\Act\STE01a8.mif';
filename NSW 'P:\Datasets\Boundary2001\STE\NSW\STE01a1.mif';
filename NT 'P:\Datasets\Boundary2001\STE\NT\STE01a7.mif';
...
...
...
%macro readin(state);
data &STATE._boundary;
infile &STATE. recfm=v lrecl=256 dsd dlm=' ' firstobs=10 truncover;
length state $3 long lat 8 record $80 segment 4;
*informat long lat 14.10;
informat record $char80.;
format long lat 14.10;
retain state "&STATE"
segment 0
points;
input record $50.;
if record in:('pen','brush') then delete;
if length(record) < 20 then
do;
segment + 1;
points = input(record,8.);
delete;
end;
else
do;
long = input(scan(record,1,' '),14.10);
lat = input(scan(record,2,' '),14.10);
end;
X = long;
Y = lat;
run;
proc gproject data=&STATE._boundary
out=&STATE._boundary_proj
EASTLONG PROJECT=GNOMON DEGREE;
ID state;
run;
pattern1 value=SOLID;
proc gmap map=&STATE._boundary_proj;
ID state;
choro state /coutline=BLACK ;
run;
quit;
%mend readin;
%readin(ACT);
%readin(NSW);
%readin(NT);
...
...
I hope that this helps you (let us know either way)
ChrisW
John wrote:
> Hi,
> I am trying to create a SAS/Graph map showing student enrollment across
> Canada. The data I have contains each student's postal code. Is there
> any information out there matching province/district with postal code
> in Canada?
>
> Also, we have our school map created in some format which I am sure
> right now, does SAS/Graph map allows importing maps in other format
> (e.g. mapinfo etc.)?
>
> Any suggestions on this would be highly appreciated.
>
> cheers,
> John