<?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: Is there an in-built SAS format to apply iso3166alphatwo for country codes? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-in-built-SAS-format-to-apply-iso3166alphatwo-for/m-p/895543#M353837</link>
    <description>&lt;P&gt;You can try making one from&amp;nbsp;mapsgfk.world_attr.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data format;
  fmtname='$ISO1366ALPHATWO';
  set mapsgfk.world_attr(keep=ISOALPHA2 isoname);
  where not missing(isoalpha2);
  rename ISOALPHA2=start isoname=label;
run;

proc format cntlin=format /* fmtlib */;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 23 Sep 2023 19:13:15 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-09-23T19:13:15Z</dc:date>
    <item>
      <title>Is there an in-built SAS format to apply iso3166alphatwo for country codes?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-in-built-SAS-format-to-apply-iso3166alphatwo-for/m-p/895542#M353836</link>
      <description>&lt;P&gt;Is there an in-built SAS format to apply iso3166alphatwo for country codes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If so, I would appreciate it if you could provide me an example code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2023 18:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-in-built-SAS-format-to-apply-iso3166alphatwo-for/m-p/895542#M353836</guid>
      <dc:creator>kkk9</dc:creator>
      <dc:date>2023-09-23T18:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an in-built SAS format to apply iso3166alphatwo for country codes?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-in-built-SAS-format-to-apply-iso3166alphatwo-for/m-p/895543#M353837</link>
      <description>&lt;P&gt;You can try making one from&amp;nbsp;mapsgfk.world_attr.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data format;
  fmtname='$ISO1366ALPHATWO';
  set mapsgfk.world_attr(keep=ISOALPHA2 isoname);
  where not missing(isoalpha2);
  rename ISOALPHA2=start isoname=label;
run;

proc format cntlin=format /* fmtlib */;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Sep 2023 19:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-in-built-SAS-format-to-apply-iso3166alphatwo-for/m-p/895543#M353837</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-23T19:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an in-built SAS format to apply iso3166alphatwo for country codes?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-in-built-SAS-format-to-apply-iso3166alphatwo-for/m-p/895596#M353854</link>
      <description>&lt;P&gt;Thank you for the reply. I would appreciate it if could explain the code and where "mapsgfk.world_attr" is located.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Sep 2023 18:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-in-built-SAS-format-to-apply-iso3166alphatwo-for/m-p/895596#M353854</guid>
      <dc:creator>kkk9</dc:creator>
      <dc:date>2023-09-24T18:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an in-built SAS format to apply iso3166alphatwo for country codes?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-in-built-SAS-format-to-apply-iso3166alphatwo-for/m-p/895599#M353856</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/454447"&gt;@kkk9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for the reply. I would appreciate it if could explain the code and where "mapsgfk.world_attr" is located.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;MAKSGFK libref is part of SAS install.&amp;nbsp; I am not sure if you have to have licensed SAS/Graph to have it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data step creates a dataset in the style needed for defining a format.&amp;nbsp; It creates the minimum required variables of FTMNAME, START and LABEL.&amp;nbsp; The PROC FORMAT step then creates the format as defined by the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not have the dataset then just copy the code/name pairs off of the internet and make your own code to create the format.&amp;nbsp; either directly in PROC FORMAT syntax. Or by first making a dataset like my code did.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Sep 2023 19:07:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-in-built-SAS-format-to-apply-iso3166alphatwo-for/m-p/895599#M353856</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-24T19:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an in-built SAS format to apply iso3166alphatwo for country codes?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-in-built-SAS-format-to-apply-iso3166alphatwo-for/m-p/895600#M353857</link>
      <description>&lt;P&gt;The MAPSGFK data library is provided by SAS as part of the SAS/GRAPH product. It includes datasets for mapping most countries and includes the WORLD_ATTR dataset. It will be available to you automatically if you have&amp;nbsp;SAS/GRAPH installed. Have you tried running&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;'s program?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Sep 2023 19:09:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-in-built-SAS-format-to-apply-iso3166alphatwo-for/m-p/895600#M353857</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-09-24T19:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an in-built SAS format to apply iso3166alphatwo for country codes?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-in-built-SAS-format-to-apply-iso3166alphatwo-for/m-p/895610#M353862</link>
      <description>&lt;P&gt;To add to what&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;already shared:&lt;/P&gt;
&lt;P&gt;If you have SAS Graph licensed then there is also already a macro library with country formats available.&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmmvacdc/9.4/grmapref/p070l47iw48y8kn1866vgs9b9jsx.htm" target="_self"&gt;Using Formats for Traditional Map Data Set Variables&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below code demonstrates how to get access to these formats.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options insert=(fmtsearch=sashelp.mapfmts);
data _null_;
  iso=364;
  put iso ison2a.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 03:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-in-built-SAS-format-to-apply-iso3166alphatwo-for/m-p/895610#M353862</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-09-25T03:34:57Z</dc:date>
    </item>
  </channel>
</rss>

