<?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: how to create new column in dataset and define continent based on country column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-new-column-in-dataset-and-define-continent-based/m-p/387126#M92796</link>
    <description>&lt;P&gt;See if you have access to the SASMAPS library on your computer. One of the datasets in there will have the mapping of countries to continents and you can use that to do the lookup.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Aug 2017 18:16:20 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-08-10T18:16:20Z</dc:date>
    <item>
      <title>how to create new column in dataset and define continent based on country column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-new-column-in-dataset-and-define-continent-based/m-p/387116#M92790</link>
      <description>&lt;P&gt;Dear All ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have column(Retailer_country) and its holding values (us,china,india,japan) now i want to identify the continent of each country&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;which it belongs to , And save it in &amp;nbsp;a new column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.This is my first sas post , Can Any one help me how i can i do this..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 18:03:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-new-column-in-dataset-and-define-continent-based/m-p/387116#M92790</guid>
      <dc:creator>hi32</dc:creator>
      <dc:date>2017-08-10T18:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to create new column in dataset and define continent based on country column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-new-column-in-dataset-and-define-continent-based/m-p/387118#M92791</link>
      <description>&lt;P&gt;Welcome to SAS forum. Typical example of a case where you would use Proc format aka user defined format and use a put function or format statement in a datastep to apply that format.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 18:07:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-new-column-in-dataset-and-define-continent-based/m-p/387118#M92791</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-08-10T18:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to create new column in dataset and define continent based on country column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-new-column-in-dataset-and-define-continent-based/m-p/387126#M92796</link>
      <description>&lt;P&gt;See if you have access to the SASMAPS library on your computer. One of the datasets in there will have the mapping of countries to continents and you can use that to do the lookup.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 18:16:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-new-column-in-dataset-and-define-continent-based/m-p/387126#M92796</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-10T18:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to create new column in dataset and define continent based on country column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-new-column-in-dataset-and-define-continent-based/m-p/387168#M92805</link>
      <description>&lt;P&gt;If you have a MAPSGFK library installed the data set Maps.gfk.World_attr has country names and a numeric code 91 to 97 for continent.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 19:31:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-new-column-in-dataset-and-define-continent-based/m-p/387168#M92805</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-10T19:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to create new column in dataset and define continent based on country column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-new-column-in-dataset-and-define-continent-based/m-p/387225#M92820</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MAPSGFK is a Library in SAS that comes with the SAS product installation(Most cases). In this Library you can find WORLD_ATTR tabel where you can find most of the well known countries with continent code. Here is my sample code( make sure the values are case-sensitive so the contries names has to be all upcase)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data country;
infile datalines;
input country $15.;
datalines;
INDIA
CHINA
UNITED STATES
JAPAN
;
RUN;
/* 91-North America, 92-South America, 93-Europe, 94-Africa, 95-Asia, 96-South Pacific. */
PROC FORMAT ;
VALUE Cont  91="North America"
            92="South America"
												93="Europe"
												94="Africa"
												95="Asia"
												96="South Pacific";
RUN;

PROC SQL;
   CREATE TABLE WORK.QUERY_FOR_COUNTRY AS 
   SELECT t1.country, 
          t2.CONT format=cont.
      FROM WORK.COUNTRY t1
           INNER JOIN MAPSGFK.WORLD_ATTR t2 ON (t1.country = t2.ISONAME);
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Suryakiran&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 03:26:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-new-column-in-dataset-and-define-continent-based/m-p/387225#M92820</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2017-08-11T03:26:33Z</dc:date>
    </item>
  </channel>
</rss>

