<?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: Convert IP address to text in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-IP-address-to-text/m-p/250696#M47292</link>
    <description>&lt;P&gt;You can write your own function or function-based format with proc FCMP and then use it just like any SAS function or SAS format in data steps and SQL.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Feb 2016 20:22:49 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-02-17T20:22:49Z</dc:date>
    <item>
      <title>Convert IP address to text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-IP-address-to-text/m-p/250677#M47287</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm a long time SAS user (since 1997) but this is my first time using this forum and submitting a request for an enhancement!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to take a 32 bit IPV4 or 128 bit IPV6 binary IP address and convert to text as dotted notation.&amp;nbsp; For example, an IPV4 is stored in binary as 4 bytes as x'0a0b0c01' and the text is up to 15 bytes&amp;nbsp; "010.011.012.001".&amp;nbsp;&amp;nbsp; While I don't have a requirement right now to go the other way, that may be useful as well (i.e., convert a char(15) field from 10.11.12.1 back into a 4 byte binary).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The equivalent functions in unix are inet_ntop (numeric to presentation) and inet_pton (presentation to numeric).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal right now is to read in a binary number and display it as dotted notation.&amp;nbsp; I can work out the SAS code to do this myself, but I really think a function or informat/format would be useful.&amp;nbsp; For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input @1 ipv4addr&amp;nbsp; pib4.&lt;/P&gt;&lt;P&gt;put @1 ipv4addr $ipv4.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The length would be implied to be either char15 if IPV4 or char35 if IPV6.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A function would work too - whichever makes sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Mike Giaquinto&lt;/P&gt;&lt;P&gt;Principal Engineer&lt;/P&gt;&lt;P&gt;Wells Fargo&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 19:16:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-IP-address-to-text/m-p/250677#M47287</guid>
      <dc:creator>mikegia5</dc:creator>
      <dc:date>2016-02-17T19:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IP address to text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-IP-address-to-text/m-p/250696#M47292</link>
      <description>&lt;P&gt;You can write your own function or function-based format with proc FCMP and then use it just like any SAS function or SAS format in data steps and SQL.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 20:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-IP-address-to-text/m-p/250696#M47292</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-02-17T20:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IP address to text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-IP-address-to-text/m-p/250852#M47323</link>
      <description>&lt;P&gt;Here's an example that might help:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sasdummy/2012/10/03/using-sas-to-convert-ip-addresses-into-numerical-ip-values/" target="_self"&gt;Using SAS to convert IP addresses into numerical IP values&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 15:30:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-IP-address-to-text/m-p/250852#M47323</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-02-18T15:30:13Z</dc:date>
    </item>
  </channel>
</rss>

