<?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: Force PROC IMPORT to import to variables of specific length from XLSX in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464252#M118358</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207566"&gt;@markc&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;What you describe shouldn't happen with the XLS&lt;STRONG&gt;X&lt;/STRONG&gt; engine.&lt;/P&gt;
&lt;P&gt;Can you give us an example of the kind of truncation you're observing?&lt;/P&gt;
&lt;P&gt;If possible: Can you post an Excel with some sample data with which you experience such truncation so we can test if that's replicable for us or limited to your environment. Also: What SAS version in what OS are you using?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 May 2018 00:22:57 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2018-05-23T00:22:57Z</dc:date>
    <item>
      <title>Force PROC IMPORT to import to variables of specific length from XLSX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464245#M118353</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using PROC IMPORT to read a file DBMS=XLSX but truncation is occurring for some vars.&amp;nbsp;&amp;nbsp; How can I define the variables which come in to be a specific length?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be Liked promptly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 23:52:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464245#M118353</guid>
      <dc:creator>markc</dc:creator>
      <dc:date>2018-05-22T23:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Force PROC IMPORT to import to variables of specific length from XLSX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464248#M118355</link>
      <description>&lt;P&gt;You don't have much control over the file if it's XLSX. The best way is to convert it to CSV and then you can use DATA step with infile and define the data attributes you like or you can use PROC IMPORT with GUESSINGROWS= to tell sas to scan all the observation to define the data type instead of default 20.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: GUESSINGROWS works only for delimited files.&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 00:03:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464248#M118355</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-05-23T00:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Force PROC IMPORT to import to variables of specific length from XLSX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464249#M118356</link>
      <description>Thank you very much Suryakiran, does GUESSINGROWS work with XLSX?</description>
      <pubDate>Wed, 23 May 2018 00:03:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464249#M118356</guid>
      <dc:creator>markc</dc:creator>
      <dc:date>2018-05-23T00:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Force PROC IMPORT to import to variables of specific length from XLSX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464250#M118357</link>
      <description>&lt;P&gt;GUESSINGROWS= will not work for XLSX files.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may try this:&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;&lt;SPAN&gt;So, open SAS 9.4, and in the command line – in the upper left corner of the screen – type&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;regedit&lt;/STRONG&gt;&lt;SPAN&gt;. Then navigate to&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Products--&amp;gt;BASE--&amp;gt;EFI--&amp;gt;GuessingRows&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;and set the value to the number of rows in the CSV or Excel file you want SAS to scan to find the longest&amp;nbsp;value. I chose 1000, because I knew I wouldn't have more than&amp;nbsp;1000 rows in an Excel file, but you could increase it up to 2147483647 (or MAX), although SAS documentation recommends not to, as it might adversely affect performance. I saw no performance hit ater I changed it to 1000.&lt;/SPAN&gt;&lt;/LI-SPOILER&gt;
&lt;P&gt;Found this &lt;A href="https://communities.sas.com/t5/SAS-Procedures/GUESSINGROWS-EXCEL-to-SAS/td-p/18505" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;and not sure if that works.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20710iD2F3391B92B9B7FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 00:14:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464250#M118357</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-05-23T00:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Force PROC IMPORT to import to variables of specific length from XLSX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464252#M118358</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207566"&gt;@markc&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;What you describe shouldn't happen with the XLS&lt;STRONG&gt;X&lt;/STRONG&gt; engine.&lt;/P&gt;
&lt;P&gt;Can you give us an example of the kind of truncation you're observing?&lt;/P&gt;
&lt;P&gt;If possible: Can you post an Excel with some sample data with which you experience such truncation so we can test if that's replicable for us or limited to your environment. Also: What SAS version in what OS are you using?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 00:22:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464252#M118358</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-05-23T00:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Force PROC IMPORT to import to variables of specific length from XLSX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464300#M118367</link>
      <description>&lt;P&gt;What I've posted probably 300 times or more here: save to csv from Excel and read with a data step. Excel files are ***** for data transfer.&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 07:58:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464300#M118367</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-05-23T07:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Force PROC IMPORT to import to variables of specific length from XLSX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464354#M118379</link>
      <description>&lt;P&gt;Try this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname x xlsx '/folders/myfolders/ntile.xlsx' dbmax_text=32767;
proc copy in=x out=work noclone;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 May 2018 12:53:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Force-PROC-IMPORT-to-import-to-variables-of-specific-length-from/m-p/464354#M118379</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-05-23T12:53:57Z</dc:date>
    </item>
  </channel>
</rss>

