<?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 EG Proc Import always treats my last column as character in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Proc-Import-always-treats-my-last-column-as-character/m-p/14980#M2991</link>
    <description>You could also try the following, which removes the specific extra character, if it is there, whether you're using Windows or Unix/Linux:&lt;BR /&gt;
&lt;BR /&gt;
  new_var = compress(old_var, '0D'x);&lt;BR /&gt;
&lt;BR /&gt;
...........Phil</description>
    <pubDate>Wed, 08 Apr 2009 20:55:13 GMT</pubDate>
    <dc:creator>prholland</dc:creator>
    <dc:date>2009-04-08T20:55:13Z</dc:date>
    <item>
      <title>SAS EG Proc Import always treats my last column as character</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Proc-Import-always-treats-my-last-column-as-character/m-p/14976#M2987</link>
      <description>it is a very simple problem: when I use the following code to import my tab delimited txt file, the last column (if it is number) will be treated as character. It is so strange, anyone met the same problem?&lt;BR /&gt;
&lt;BR /&gt;
PROC IMPORT OUT= cpa.score &lt;BR /&gt;
            DATAFILE= "/home/sg/cc/cpa/score.txt" &lt;BR /&gt;
            DBMS=TAB REPLACE;&lt;BR /&gt;
&lt;BR /&gt;
     GETNAMES=YES;&lt;BR /&gt;
     GUESSINGROWS=10000;&lt;BR /&gt;
     DATAROW=2;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
My temporary solution is to manully add in a 'junk' column into my txt file as the last column, so my real last column become the second-last column, then the problem gone.</description>
      <pubDate>Fri, 03 Apr 2009 02:59:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Proc-Import-always-treats-my-last-column-as-character/m-p/14976#M2987</guid>
      <dc:creator>armor</dc:creator>
      <dc:date>2009-04-03T02:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG Proc Import always treats my last column as character</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Proc-Import-always-treats-my-last-column-as-character/m-p/14977#M2988</link>
      <description>Just guessing: the text file has been created on a Windows PC and SAS is running on Unix/Linux. One difference between both operating systems is the newline char. While Windows uses Carriage Return and Line Feed, the *nix-systems use only one of the chars. The problem can be solved by using dos2unix in the shell of the unix-box to transform the newline chars.</description>
      <pubDate>Fri, 03 Apr 2009 06:42:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Proc-Import-always-treats-my-last-column-as-character/m-p/14977#M2988</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2009-04-03T06:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG Proc Import always treats my last column as character</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Proc-Import-always-treats-my-last-column-as-character/m-p/14978#M2989</link>
      <description>Just guessing: the text file has been created on a Windows PC and SAS is running on Unix/Linux. &lt;BR /&gt;
====================================&lt;BR /&gt;
&lt;BR /&gt;
andreas,  you are right, I create the txt file on my desktop and then upload it to the EG server. &lt;BR /&gt;
&lt;BR /&gt;
I will go back to test it next Monday, and then feedback my results/solution(s). &lt;BR /&gt;
&lt;BR /&gt;
Thanks,</description>
      <pubDate>Fri, 03 Apr 2009 14:02:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Proc-Import-always-treats-my-last-column-as-character/m-p/14978#M2989</guid>
      <dc:creator>armor</dc:creator>
      <dc:date>2009-04-03T14:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG Proc Import always treats my last column as character</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Proc-Import-always-treats-my-last-column-as-character/m-p/14979#M2990</link>
      <description>I tried the simplest solution for me to do, and it works,&lt;BR /&gt;
&lt;BR /&gt;
"&lt;BR /&gt;
format os1 best32.;&lt;BR /&gt;
os1=substr(os,1,length(os)-1)*1;&lt;BR /&gt;
"&lt;BR /&gt;
&lt;BR /&gt;
my old variable os is a char variable with a anoiyning Carriage Return or Line Feed (or whatever it is, but it is an invisible char at the tail of the variable in my SAS table). I used substr function to remove it and then times 1, then i got my new os1 in numeric format.

Message was edited by: armor</description>
      <pubDate>Mon, 06 Apr 2009 02:07:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Proc-Import-always-treats-my-last-column-as-character/m-p/14979#M2990</guid>
      <dc:creator>armor</dc:creator>
      <dc:date>2009-04-06T02:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG Proc Import always treats my last column as character</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Proc-Import-always-treats-my-last-column-as-character/m-p/14980#M2991</link>
      <description>You could also try the following, which removes the specific extra character, if it is there, whether you're using Windows or Unix/Linux:&lt;BR /&gt;
&lt;BR /&gt;
  new_var = compress(old_var, '0D'x);&lt;BR /&gt;
&lt;BR /&gt;
...........Phil</description>
      <pubDate>Wed, 08 Apr 2009 20:55:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Proc-Import-always-treats-my-last-column-as-character/m-p/14980#M2991</guid>
      <dc:creator>prholland</dc:creator>
      <dc:date>2009-04-08T20:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG Proc Import always treats my last column as character</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Proc-Import-always-treats-my-last-column-as-character/m-p/14981#M2992</link>
      <description>You can also use a data step solution  :&lt;BR /&gt;
&lt;BR /&gt;
data ... ;&lt;BR /&gt;
  attrib&lt;BR /&gt;
    ... ;&lt;BR /&gt;
  infile&lt;BR /&gt;
    'your/file.txt' dlm = ... &lt;B&gt;TERMSTR = CRLF&lt;/B&gt; ;&lt;BR /&gt;
  input&lt;BR /&gt;
    ... ;&lt;BR /&gt;
run ;&lt;BR /&gt;
&lt;BR /&gt;
"TERMSTR = CRLF" will tell SAS that lines are ending with a Carriage Return / Line Feed (Windows format).</description>
      <pubDate>Wed, 08 Apr 2009 22:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Proc-Import-always-treats-my-last-column-as-character/m-p/14981#M2992</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-08T22:06:06Z</dc:date>
    </item>
  </channel>
</rss>

