<?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: Reading in data formatted differently. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-data-formatted-differently/m-p/317625#M313267</link>
    <description>&lt;P&gt;Thanks! It worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Dec 2016 15:47:12 GMT</pubDate>
    <dc:creator>Peadymarvin</dc:creator>
    <dc:date>2016-12-08T15:47:12Z</dc:date>
    <item>
      <title>Reading in data formatted differently.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-data-formatted-differently/m-p/317371#M313262</link>
      <description>&lt;P&gt;Hello, I am a student working on a project and I have come across a problem that I can't solve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am reading in data that deals with colleges and one of the variables is a ratio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that the ratios were entered in two different ways, sometimes they were entered in the standard 'X : Y' format and other times they were simply entered as a decimal such as 1.75.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to create an informat that will be able to read in the ratios along with the decimals? Thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;2.159027778&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1.790277778&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;33 : 67&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2.240972222&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1.954166667&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2.56875&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0.602083333&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0.847916667&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;39 : 61&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 07 Dec 2016 16:32:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-data-formatted-differently/m-p/317371#M313262</guid>
      <dc:creator>Peadymarvin</dc:creator>
      <dc:date>2016-12-07T16:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in data formatted differently.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-data-formatted-differently/m-p/317378#M313263</link>
      <description>&lt;P&gt;As pasted there is some other character between the numerals and the : . Is that the actual case in your data? If so what is the character as you see it? Sometimes things pasted into the forum, especially from a non-plain text source such as EXCEL, acquire additional "stuff".&lt;/P&gt;
&lt;P&gt;If this is a ratio such as 39:61 I would suspect that you want the division of 39/61 done, correct?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2016 16:50:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-data-formatted-differently/m-p/317378#M313263</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-12-07T16:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in data formatted differently.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-data-formatted-differently/m-p/317380#M313264</link>
      <description>&lt;P&gt;I pasted from excel but I don't see anything else besides the decimal and the colon between numbers?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes that would be the end goal&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2016 16:54:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-data-formatted-differently/m-p/317380#M313264</guid>
      <dc:creator>Peadymarvin</dc:creator>
      <dc:date>2016-12-07T16:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in data formatted differently.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-data-formatted-differently/m-p/317381#M313265</link>
      <description>&lt;P&gt;You can overcome the situation by reading the ratio in an alphanumeric temporary variable&amp;nbsp;&lt;/P&gt;
&lt;P&gt;defined with informat $12, then code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;if indexc(temp_var,':') &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;then ratio = input(scan(temp_var,1,':'),best3.) / input(scan(temp_var,2,':'),best3.);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;else ratio = input(temp_var, best12.9 );&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2016 16:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-data-formatted-differently/m-p/317381#M313265</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-12-07T16:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in data formatted differently.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-data-formatted-differently/m-p/317409#M313266</link>
      <description>&lt;P&gt;It may be my work browser, Internet Explorer, but just looking at the pasted values there is a space between the colon and the digits on each side.&lt;/P&gt;
&lt;P&gt;Copied and paste from the first post:&lt;/P&gt;
&lt;P&gt;39 : 61&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Typed:&lt;/P&gt;
&lt;P&gt;39:61&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2016 18:27:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-data-formatted-differently/m-p/317409#M313266</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-12-07T18:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in data formatted differently.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-data-formatted-differently/m-p/317625#M313267</link>
      <description>&lt;P&gt;Thanks! It worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2016 15:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-data-formatted-differently/m-p/317625#M313267</guid>
      <dc:creator>Peadymarvin</dc:creator>
      <dc:date>2016-12-08T15:47:12Z</dc:date>
    </item>
  </channel>
</rss>

