<?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: Urgent: How to modify the variable type (character or numeric) in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-How-to-modify-the-variable-type-character-or-numeric/m-p/68293#M6804</link>
    <description>If you don't have mixed datatypes in your intended numerical column, PROC IMPORT should be able to set the column to numeric.&lt;BR /&gt;
&lt;BR /&gt;
To change (or rather to convert the contents to be stored in a new column) a char column to numeric in the data step, use the INPUT function.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
    <pubDate>Fri, 09 Jan 2009 08:36:05 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2009-01-09T08:36:05Z</dc:date>
    <item>
      <title>Urgent: How to modify the variable type (character or numeric)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-How-to-modify-the-variable-type-character-or-numeric/m-p/68292#M6803</link>
      <description>&lt;B&gt;When I inport CSV files into SAS EG by SAS code (as below), the type of the variables are changed from numeric to character. How can I modify the type by code? &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
PROC IMPORT &lt;BR /&gt;
DATAFILE= "/home/&amp;amp;MONTH..csv"&lt;BR /&gt;
OUT= CPMS.&amp;amp;MONTH REPLACE;&lt;BR /&gt;
GETNAMES=NO;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
DATA &amp;amp;MONTH;&lt;BR /&gt;
SET &amp;amp;MONTH&lt;BR /&gt;
(RENAME =&lt;BR /&gt;
(var1	=	CUSTOMERID&lt;BR /&gt;
var2	=	CUSTOMERNAME&lt;BR /&gt;
var3	=	TOT_LIMIT));&lt;BR /&gt;
MONTH = &amp;amp;MONTH;&lt;BR /&gt;
where Customerid &amp;lt;&amp;gt; 999;&lt;BR /&gt;
&lt;BR /&gt;
RUN;&lt;/B&gt;</description>
      <pubDate>Fri, 09 Jan 2009 08:07:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-How-to-modify-the-variable-type-character-or-numeric/m-p/68292#M6803</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-09T08:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent: How to modify the variable type (character or numeric)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-How-to-modify-the-variable-type-character-or-numeric/m-p/68293#M6804</link>
      <description>If you don't have mixed datatypes in your intended numerical column, PROC IMPORT should be able to set the column to numeric.&lt;BR /&gt;
&lt;BR /&gt;
To change (or rather to convert the contents to be stored in a new column) a char column to numeric in the data step, use the INPUT function.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Fri, 09 Jan 2009 08:36:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-How-to-modify-the-variable-type-character-or-numeric/m-p/68293#M6804</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-01-09T08:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent: How to modify the variable type (character or numeric)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-How-to-modify-the-variable-type-character-or-numeric/m-p/68294#M6805</link>
      <description>Thanks Linus.&lt;BR /&gt;
&lt;BR /&gt;
Is this type (eg.1,396,123.05) are mixed datatype? All the variable in this type are converted into character.&lt;BR /&gt;
&lt;BR /&gt;
Actually, I need to import a set of CSV files (around 50 files), which have different combination of variables (around 20 combinations).It is very time consuming to use INPUT function to input files one by one.&lt;BR /&gt;
&lt;BR /&gt;
Is there any other mrthod? Thanks so much!</description>
      <pubDate>Fri, 09 Jan 2009 08:48:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-How-to-modify-the-variable-type-character-or-numeric/m-p/68294#M6805</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-09T08:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent: How to modify the variable type (character or numeric)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-How-to-modify-the-variable-type-character-or-numeric/m-p/68295#M6806</link>
      <description>Not mixed, but it's formatted numerical data, that PROC IMPORT will interpret as CHAR. Unfortunately PROC IMPORT does nor support INFORMAT, and I'm not aware of any generic way to set a INFORMAT as default. If you have a name standard for columns with these formatted values, you may do some macro coding.&lt;BR /&gt;
&lt;BR /&gt;
The alternative is when using EG, you can specify informats during import (this beacuse EG does not use PROC IMPORT). But this will be per file basis...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Fri, 09 Jan 2009 11:10:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-How-to-modify-the-variable-type-character-or-numeric/m-p/68295#M6806</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-01-09T11:10:24Z</dc:date>
    </item>
  </channel>
</rss>

