<?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 all numeric variables as character variables from .csv files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/278416#M56014</link>
    <description>&lt;P&gt;If you want PROC IMPORT to have an option to import all fields as character, please vote:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SASware-Ballot-Ideas/PROC-IMPORT-all-fields-as-character/idi-p/278415#M2011" target="_blank"&gt;PROC IMPORT -- all fields as character&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 18 Jun 2016 22:01:27 GMT</pubDate>
    <dc:creator>agoldma</dc:creator>
    <dc:date>2016-06-18T22:01:27Z</dc:date>
    <item>
      <title>Reading in all numeric variables as character variables from .csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171235#M32866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Our analytics group is attempting to work with data files in .csv format with variable type inconsistencies.&amp;nbsp; In some cases the variables from the source files are character (this is correct) in other files the same variables with the same names are numeric and causing errors on import and data manipulation.&amp;nbsp; Is there some way to format all input variables in a list and covert them to character formats if they happen to exist as numeric fields?&amp;nbsp; If so what would the syntax look like?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 21:51:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171235#M32866</guid>
      <dc:creator>Jordana</dc:creator>
      <dc:date>2014-02-11T21:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in all numeric variables as character variables from .csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171236#M32867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you're importing multiple files of the same type don't use proc import, use a "manual" import instead. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Run Proc Import once, get the code from the log and modify it to be what you want.&amp;nbsp; Then use that code to import the rest of the files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're importing many files you'll need to tweak each one somehow, but you could automate it if you did have naming conventions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 22:00:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171236#M32867</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-02-11T22:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in all numeric variables as character variables from .csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171237#M32868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reeza, thank you for the quick response.&amp;nbsp; Do you have sample syntax?&amp;nbsp; I have over 20 source files with this inconsistency issue and manual statements may work but I am hoping to avoid too much typing.&amp;nbsp; I was able to fix the issue using Proc Import followed by put statements but each variable requires a put (about three lines of syntax) for about seven variables per file; any way I have thought of so far gets to quite a bit of coding.&amp;nbsp; Any syntax shortcuts are welcome! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 23:02:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171237#M32868</guid>
      <dc:creator>Jordana</dc:creator>
      <dc:date>2014-02-11T23:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in all numeric variables as character variables from .csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171238#M32869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are the files the same structure/format?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 23:05:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171238#M32869</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-02-11T23:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in all numeric variables as character variables from .csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171239#M32870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;They are indeed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 23:06:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171239#M32870</guid>
      <dc:creator>Jordana</dc:creator>
      <dc:date>2014-02-11T23:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in all numeric variables as character variables from .csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171240#M32871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are the csv files being created? Some tools (e.g. Excel) will look at the first several rows to determine format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 23:27:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171240#M32871</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2014-02-11T23:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in all numeric variables as character variables from .csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171241#M32872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then once you've fixed it once you're done. Just change where the import for the .csv file. On a separate note you can read all files at once using a wild card in your filename statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need help besides this, I'd suggest posting code &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 23:28:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171241#M32872</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-02-11T23:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in all numeric variables as character variables from .csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171242#M32873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just write the code to read the files using a data step.&lt;/P&gt;&lt;P&gt;All you need to know is the names of the variables and the types and lengths to use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile 'myfile.csv' dsd dlm=',' lrecl=100000 truncover firstobs=2 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length var1 8 var2 $50 var3 $25 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input var1 var2 var3 ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 23:49:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171242#M32873</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-02-11T23:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in all numeric variables as character variables from .csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171243#M32874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you, I will give this a try! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2014 15:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/171243#M32874</guid>
      <dc:creator>Jordana</dc:creator>
      <dc:date>2014-02-12T15:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in all numeric variables as character variables from .csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/278416#M56014</link>
      <description>&lt;P&gt;If you want PROC IMPORT to have an option to import all fields as character, please vote:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SASware-Ballot-Ideas/PROC-IMPORT-all-fields-as-character/idi-p/278415#M2011" target="_blank"&gt;PROC IMPORT -- all fields as character&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jun 2016 22:01:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-in-all-numeric-variables-as-character-variables-from-csv/m-p/278416#M56014</guid>
      <dc:creator>agoldma</dc:creator>
      <dc:date>2016-06-18T22:01:27Z</dc:date>
    </item>
  </channel>
</rss>

