<?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: SAS could not read variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/312667#M67841</link>
    <description>&lt;P&gt;The default length of a character variable when input as your code shows will be 8 characters.&lt;/P&gt;
&lt;P&gt;Since your phonenumber varaible was declared to be a numeric variable (no $) it expects nothing but numeric values. The dash in the middle is character and so SAS treats it as non-numeric and you get blank values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an example I would suggest looking at using the data import wizard (File&amp;gt;Import Data) and follow the prompts. This will generate and run Proc import code. Take a look at all of the options as they are presented and set a largish value for guessingrows when you find that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The LOG will show the Data step code generated and you can compare that, or better copy&amp;nbsp; it from the log to the editor and modify as you may want to add labels, change display formats or other operations you want after the input.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Nov 2016 16:22:14 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-11-18T16:22:14Z</dc:date>
    <item>
      <title>SAS could not read variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/312658#M67834</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am new to the SAS programming. I having one problem: The SAS could not read two variables from the data set (.dat file). I have enclosed one dimension of the data set below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;Faculty Charles Porter &lt;A href="mailto:charles.porter@csu.edu" target="_blank"&gt;charles.porter@csu.edu&lt;/A&gt; 555-8511 AERO&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;out of 6 variables above(RowID Group FirstName LastName EmailAddress PhoneNumber and Dept);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EmailAddress and PhoneNumber donot show up in the output results. Under the EmailAddress column- output show like this:&lt;STRONG&gt;email:ch&lt;/STRONG&gt; and PhoneNumber is &lt;STRONG&gt;blank&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data Cusers;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;infile 'sas/vrdc/......................./comusers.dat';&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;input RowID Group$ FirstName$ LastName$ EmailAddress$ PhoneNumber Department$;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know where is the probelm in the code to read these two variables correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sahib&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 16:12:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/312658#M67834</guid>
      <dc:creator>saamiq</dc:creator>
      <dc:date>2016-11-18T16:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS could not read variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/312666#M67839</link>
      <description>&lt;P&gt;Several things:&lt;/P&gt;
&lt;P&gt;1) There is no "rowid" in the test data you give.&lt;/P&gt;
&lt;P&gt;2) Phone number is a text string as "-" is not numeric within a number&lt;/P&gt;
&lt;P&gt;3) put a space before the $&lt;/P&gt;
&lt;P&gt;4) Set the length of each variable, otherwise it will default to 8 and chop off the end&lt;/P&gt;
&lt;P&gt;5) Specify delimiter&lt;/P&gt;
&lt;P&gt;Update to:&lt;/P&gt;
&lt;PRE&gt;data Cusers;
  length group firstname lastname emailaddress phonenumber department $100;
   infile datalines dlm=" ";
   input Group $ FirstName $ LastName $ EmailAddress $ PhoneNumber $ Department $;
datalines;
Faculty Charles Porter charles.porter@csu.edu 555-8511 AERO
;
Run;&lt;/PRE&gt;
&lt;P&gt;This uses datalines, but you can just replace datalines with your file and drop that part.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 16:21:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/312666#M67839</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-18T16:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS could not read variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/312667#M67841</link>
      <description>&lt;P&gt;The default length of a character variable when input as your code shows will be 8 characters.&lt;/P&gt;
&lt;P&gt;Since your phonenumber varaible was declared to be a numeric variable (no $) it expects nothing but numeric values. The dash in the middle is character and so SAS treats it as non-numeric and you get blank values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an example I would suggest looking at using the data import wizard (File&amp;gt;Import Data) and follow the prompts. This will generate and run Proc import code. Take a look at all of the options as they are presented and set a largish value for guessingrows when you find that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The LOG will show the Data step code generated and you can compare that, or better copy&amp;nbsp; it from the log to the editor and modify as you may want to add labels, change display formats or other operations you want after the input.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 16:22:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/312667#M67841</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-11-18T16:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS could not read variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/312675#M67846</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Thank you very much it works now. Really appreciated.&lt;BR /&gt;&lt;BR /&gt;Sahib&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Nov 2016 16:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/312675#M67846</guid>
      <dc:creator>saamiq</dc:creator>
      <dc:date>2016-11-18T16:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS could not read variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/312676#M67847</link>
      <description>&lt;P&gt;It works now, Thank you very much.&lt;/P&gt;&lt;P&gt;Sahib&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 16:41:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/312676#M67847</guid>
      <dc:creator>saamiq</dc:creator>
      <dc:date>2016-11-18T16:41:04Z</dc:date>
    </item>
    <item>
      <title>Accepted a Solution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/314301#M68430</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have accepted a solutions, so problem is solved.&lt;/P&gt;&lt;P&gt;Thank you for your support.&lt;/P&gt;&lt;P&gt;Sahib&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2016 13:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/314301#M68430</guid>
      <dc:creator>saamiqbal</dc:creator>
      <dc:date>2016-11-25T13:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Accepted a Solution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/314305#M68431</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you then the same poster as the original question, not sure as the username has changed. &amp;nbsp;If so please mark the correct answer as correct, so its closed. &amp;nbsp;If your not the original poster, your post doesn't make sense?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2016 14:12:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-could-not-read-variables/m-p/314305#M68431</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-25T14:12:54Z</dc:date>
    </item>
  </channel>
</rss>

