<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Tried to change numeric to character to match a map data set, and help. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Tried-to-change-numeric-to-character-to-match-a-map-data-set-and/m-p/439039#M282372</link>
    <description>&lt;P&gt;THANK YOU. That worked perfectly. I knew it was something simple I was missing; you spend so long staring at the code that it all blurs together.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Feb 2018 19:08:26 GMT</pubDate>
    <dc:creator>jesspurse</dc:creator>
    <dc:date>2018-02-21T19:08:26Z</dc:date>
    <item>
      <title>Tried to change numeric to character to match a map data set, and help.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tried-to-change-numeric-to-character-to-match-a-map-data-set-and/m-p/439028#M282370</link>
      <description>&lt;P&gt;Hi! I'm trying to create a map using ZCTAs and then number of doctors in a zip code, but I'm having issues with import. This is my code for SAS 9.4:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Import ZCTA boundary file*/
Proc MAPIMPORT OUT=sczip
			Datafile= "C:\tl_2010_45_zcta510\tl_2010_45_zcta510.shp";
run;
/* import excel file*/
PROC IMPORT OUT= WORK.zipsum
			DATAFILE="C:\allzipsum.xlsx"
            DBMS=xlsx replace;
			GETNAMES=YES;
RUN;
/*change zipcode to character*/
data work.zipsum;
ZCTA5CE10= put(zipcode,5.);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The ZCTA variable in the map data set is character and has the format and informat $5, and I have to match it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS keeps&amp;nbsp;telling me that zipcode is uninitialized. Then it deletes the other variable in the dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using DBDSOPTS, and SAS didn't recognize the command, so I'm at a loss of what to do next.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 18:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tried-to-change-numeric-to-character-to-match-a-map-data-set-and/m-p/439028#M282370</guid>
      <dc:creator>jesspurse</dc:creator>
      <dc:date>2018-02-21T18:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Tried to change numeric to character to match a map data set, and help.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tried-to-change-numeric-to-character-to-match-a-map-data-set-and/m-p/439035#M282371</link>
      <description>&lt;P&gt;You don't have a SET statement and you shouldn't use the same data set name again, that will likely destroy your original data so you'll have to re-import it again.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.zipsum_with_zipCode;
set zipsum;

ZCTA5CE10= put(zipcode,5.);

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/194587"&gt;@jesspurse&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi! I'm trying to create a map using ZCTAs and then number of doctors in a zip code, but I'm having issues with import. This is my code for SAS 9.4:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Import ZCTA boundary file*/
Proc MAPIMPORT OUT=sczip
			Datafile= "C:\tl_2010_45_zcta510\tl_2010_45_zcta510.shp";
run;
/* import excel file*/
PROC IMPORT OUT= WORK.zipsum
			DATAFILE="C:\allzipsum.xlsx"
            DBMS=xlsx replace;
			GETNAMES=YES;
RUN;
/*change zipcode to character*/
data work.zipsum;
ZCTA5CE10= put(zipcode,5.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The ZCTA variable in the map data set is character and has the format and informat $5, and I have to match it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS keeps&amp;nbsp;telling me that zipcode is uninitialized. Then it deletes the other variable in the dataset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried using DBDSOPTS, and SAS didn't recognize the command, so I'm at a loss of what to do next.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 19:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tried-to-change-numeric-to-character-to-match-a-map-data-set-and/m-p/439035#M282371</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-21T19:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Tried to change numeric to character to match a map data set, and help.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tried-to-change-numeric-to-character-to-match-a-map-data-set-and/m-p/439039#M282372</link>
      <description>&lt;P&gt;THANK YOU. That worked perfectly. I knew it was something simple I was missing; you spend so long staring at the code that it all blurs together.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 19:08:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tried-to-change-numeric-to-character-to-match-a-map-data-set-and/m-p/439039#M282372</guid>
      <dc:creator>jesspurse</dc:creator>
      <dc:date>2018-02-21T19:08:26Z</dc:date>
    </item>
  </channel>
</rss>

