<?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: Import Proc: Scanning DataTypes in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Import-Proc-Scanning-DataTypes/m-p/552922#M7437</link>
    <description>Your diagnosis isn't quite right.&lt;BR /&gt;&lt;BR /&gt;If importing made a variable character, it means one or more of the values found contains characters that can't be translated to numeric.  Examining additional rows won't change that.  Inspect the data to see which values can't be stored as numeric, so you can decide what the proper course of action would be.</description>
    <pubDate>Mon, 22 Apr 2019 15:59:01 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-04-22T15:59:01Z</dc:date>
    <item>
      <title>Import Proc: Scanning DataTypes</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Import-Proc-Scanning-DataTypes/m-p/552899#M7435</link>
      <description>&lt;PRE&gt;Hi Community,&lt;BR /&gt;The following code produces almost what I need. It sets all the data types to the right value except one.&lt;BR /&gt;The one it does not set correctly is the result that it did not do a large enough scan on the data&lt;BR /&gt;to determine that it was numeric rather than character. Is there a option that I can add which will &lt;BR /&gt;scan more values than the default? I know there are a number of  options starting with "SCAN" like &lt;BR /&gt;"SCANTEXT" but there don't seem to fit the bill. Any insight?&lt;BR /&gt;&lt;BR /&gt;PROC IMPORT OUT = Export.TDSR_InterfaceTestOutDec19_5&lt;BR /&gt;       DATAFILE= '/sasshare/prd/AUDIT/BlackMESA/Dec_Test4'&lt;BR /&gt;       DBMS=DLM REPLACE;&lt;BR /&gt;       DELIMITER = "|";&lt;BR /&gt;       GETNAMES = YES;&lt;BR /&gt;RUN;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2019 15:17:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Import-Proc-Scanning-DataTypes/m-p/552899#M7435</guid>
      <dc:creator>BruceTao</dc:creator>
      <dc:date>2019-04-22T15:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Import Proc: Scanning DataTypes</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Import-Proc-Scanning-DataTypes/m-p/552917#M7436</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/271037"&gt;@BruceTao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;Hi Community,&lt;BR /&gt;The following code produces almost what I need. It sets all the data types to the right value except one.&lt;BR /&gt;The one it does not set correctly is the result that it did not do a large enough scan on the data&lt;BR /&gt;to determine that it was numeric rather than character. Is there a option that I can add which will &lt;BR /&gt;scan more values than the default? I know there are a number of  options starting with "SCAN" like &lt;BR /&gt;"SCANTEXT" but there don't seem to fit the bill. Any insight?&lt;BR /&gt;&lt;BR /&gt;PROC IMPORT OUT = Export.TDSR_InterfaceTestOutDec19_5&lt;BR /&gt;       DATAFILE= '/sasshare/prd/AUDIT/BlackMESA/Dec_Test4'&lt;BR /&gt;       DBMS=DLM REPLACE;&lt;BR /&gt;       DELIMITER = "|";&lt;BR /&gt;       GETNAMES = YES;&lt;BR /&gt;RUN;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;See if adding the GUESSINGROWS= &amp;nbsp;option helps. Use a number that is about the number of rows in the data file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However if the values do not contain any characters other than digits and decimal points the value will continue to be numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option when this occurs is the copy the data step code generated by Proc Import into the editor and modify the informat statement to use a character informat instead of numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are going to read multiple files in the same layout you will likely be better off to keep the data step generated, make sure any lengths are long enough for expected values and the use the data step code changing the infile and the output data set. With separate guesses the lengths of variables will likely vary from file to file using import and frequently causes issues when appending multiple files together as values may get truncated. In some cases you may even have variables change types.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2019 15:49:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Import-Proc-Scanning-DataTypes/m-p/552917#M7436</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-22T15:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Import Proc: Scanning DataTypes</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Import-Proc-Scanning-DataTypes/m-p/552922#M7437</link>
      <description>Your diagnosis isn't quite right.&lt;BR /&gt;&lt;BR /&gt;If importing made a variable character, it means one or more of the values found contains characters that can't be translated to numeric.  Examining additional rows won't change that.  Inspect the data to see which values can't be stored as numeric, so you can decide what the proper course of action would be.</description>
      <pubDate>Mon, 22 Apr 2019 15:59:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Import-Proc-Scanning-DataTypes/m-p/552922#M7437</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-04-22T15:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Import Proc: Scanning DataTypes</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Import-Proc-Scanning-DataTypes/m-p/553309#M7443</link>
      <description>&lt;P&gt;This worked like a charm. I really like this SAS Forum. Great and quick answers. I am glad to be apart of it.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2019 15:21:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Import-Proc-Scanning-DataTypes/m-p/553309#M7443</guid>
      <dc:creator>BruceTao</dc:creator>
      <dc:date>2019-04-23T15:21:45Z</dc:date>
    </item>
  </channel>
</rss>

