<?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 raw data set (The length of numeric variables is 3-8. ) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-data-set-The-length-of-numeric-variables-is-3-8/m-p/110714#M22983</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would read this paper to better understand how SAS stores numeric data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.nesug.org/proceedings/nesug02/at/at002.pdf" title="http://www.nesug.org/proceedings/nesug02/at/at002.pdf"&gt;http://www.nesug.org/proceedings/nesug02/at/at002.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data foo;&lt;/P&gt;&lt;P&gt; length _numeric_ 3; * I choose 3 instead of default of 8 because all my data is &amp;lt;= 8192 and I want to save space;&lt;/P&gt;&lt;P&gt; input (name type) ($) start width decimals;&lt;/P&gt;&lt;P&gt; cards;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v1 C 1 1 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v2 C 2 3 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v3 C 5 3 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v4 C 8 3 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v5 C 11 3 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v6 C 14 4 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v7 C 18 4 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v8 C 22 4 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v9 C 26 4 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v10 C 30 2 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v11 C 32 2 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v12 C 34 6 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v13 C 40 1 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;U01 I 41 9 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;U02 I 50 9 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;U03 F 59 9 1&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;U04 I 68 9 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 May 2012 18:22:19 GMT</pubDate>
    <dc:creator>FriedEgg</dc:creator>
    <dc:date>2012-05-10T18:22:19Z</dc:date>
    <item>
      <title>Reading raw data set (The length of numeric variables is 3-8. )</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-data-set-The-length-of-numeric-variables-is-3-8/m-p/110713#M22982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've got an error message: &lt;SPAN style="color: #800000;"&gt;The length of numeric variables is 3-8&lt;/SPAN&gt;. I attached the raw data file (mydata). How can I load this data in SAS? Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is my data's layout information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name type start width decimals&lt;/P&gt;&lt;P&gt;v1 C 1 1 0&lt;/P&gt;&lt;P&gt;v2 C 2 3 0&lt;/P&gt;&lt;P&gt;v3 C 5 3 0&lt;/P&gt;&lt;P&gt;v4 C 8 3 0&lt;/P&gt;&lt;P&gt;v5 C 11 3 0&lt;/P&gt;&lt;P&gt;v6 C 14 4 0&lt;/P&gt;&lt;P&gt;v7 C 18 4 0&lt;/P&gt;&lt;P&gt;v8 C 22 4 0&lt;/P&gt;&lt;P&gt;v9 C 26 4 0&lt;/P&gt;&lt;P&gt;v10 C 30 2 0&lt;/P&gt;&lt;P&gt;v11 C 32 2 0&lt;/P&gt;&lt;P&gt;v12 C 34 6 0&lt;/P&gt;&lt;P&gt;v13 C 40 1 0&lt;/P&gt;&lt;P&gt;U01 I 41 9 0&lt;/P&gt;&lt;P&gt;U02 I 50 9 0&lt;/P&gt;&lt;P&gt;U03 F 59 9 1&lt;/P&gt;&lt;P&gt;U04 I 68 9 0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 18:13:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-data-set-The-length-of-numeric-variables-is-3-8/m-p/110713#M22982</guid>
      <dc:creator>tesu</dc:creator>
      <dc:date>2012-05-10T18:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw data set (The length of numeric variables is 3-8. )</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-data-set-The-length-of-numeric-variables-is-3-8/m-p/110714#M22983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would read this paper to better understand how SAS stores numeric data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.nesug.org/proceedings/nesug02/at/at002.pdf" title="http://www.nesug.org/proceedings/nesug02/at/at002.pdf"&gt;http://www.nesug.org/proceedings/nesug02/at/at002.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data foo;&lt;/P&gt;&lt;P&gt; length _numeric_ 3; * I choose 3 instead of default of 8 because all my data is &amp;lt;= 8192 and I want to save space;&lt;/P&gt;&lt;P&gt; input (name type) ($) start width decimals;&lt;/P&gt;&lt;P&gt; cards;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v1 C 1 1 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v2 C 2 3 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v3 C 5 3 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v4 C 8 3 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v5 C 11 3 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v6 C 14 4 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v7 C 18 4 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v8 C 22 4 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v9 C 26 4 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v10 C 30 2 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v11 C 32 2 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v12 C 34 6 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;v13 C 40 1 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;U01 I 41 9 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;U02 I 50 9 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;U03 F 59 9 1&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;U04 I 68 9 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 18:22:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-data-set-The-length-of-numeric-variables-is-3-8/m-p/110714#M22983</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-05-10T18:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw data set (The length of numeric variables is 3-8. )</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-data-set-The-length-of-numeric-variables-is-3-8/m-p/110715#M22984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To continue the learning experience, try running FriedEgg's program and then run a PROC CONTENTS on the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then swap the order of the LENGTH and INPUT statements, and repeat the process.&amp;nbsp; Notice how the length of&amp;nbsp; your numeric variables changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 19:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-data-set-The-length-of-numeric-variables-is-3-8/m-p/110715#M22984</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-05-10T19:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw data set (The length of numeric variables is 3-8. )</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-data-set-The-length-of-numeric-variables-is-3-8/m-p/110716#M22985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all. The attached "mydata" is the actual data file. Sorry for the confusion. Anyway, by taking Astounding's advice of INPUT statements, I could first read the U1-U4 variables as character, and then convert them into numeric using the INPUT statements: U1new = input(U1, 9.).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2012 00:19:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-data-set-The-length-of-numeric-variables-is-3-8/m-p/110716#M22985</guid>
      <dc:creator>tesu</dc:creator>
      <dc:date>2012-05-11T00:19:44Z</dc:date>
    </item>
  </channel>
</rss>

