<?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 Importing Long Text from Excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668264#M200293</link>
    <description>&lt;P&gt;I have a couple of variables that have long text data in excel. When I import it with import statement it stops at 175 characters. I want to be able to get full text length.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;IMPORT&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;OUT&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;= WORK.ge &lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;DATAFILE&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;= &lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"filepath/name"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;DBMS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=xlsx REPLACE;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;SHEET&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"One"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;GETNAMES&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=YES;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 06:05:16 GMT</pubDate>
    <dc:creator>rajd1</dc:creator>
    <dc:date>2020-07-10T06:05:16Z</dc:date>
    <item>
      <title>Importing Long Text from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668264#M200293</link>
      <description>&lt;P&gt;I have a couple of variables that have long text data in excel. When I import it with import statement it stops at 175 characters. I want to be able to get full text length.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;IMPORT&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="2" color="#0000ff"&gt;OUT&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;= WORK.ge &lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;DATAFILE&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;= &lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"filepath/name"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;DBMS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=xlsx REPLACE;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;SHEET&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"One"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;GETNAMES&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=YES;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 06:05:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668264#M200293</guid>
      <dc:creator>rajd1</dc:creator>
      <dc:date>2020-07-10T06:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Long Text from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668269#M200298</link>
      <description>Hi rajd1,&lt;BR /&gt;&lt;BR /&gt;please give the length of the variable you want to store the long text. Because SAS will default that the length of this variable is the length of the first data value you entered.</description>
      <pubDate>Fri, 10 Jul 2020 06:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668269#M200298</guid>
      <dc:creator>hyo_tree</dc:creator>
      <dc:date>2020-07-10T06:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Long Text from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668280#M200303</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/267531"&gt;@hyo_tree&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi rajd1,&lt;BR /&gt;&lt;BR /&gt;please give the length of the variable you want to store the long text. Because SAS will default that the length of this variable is the length of the first data value you entered.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/267531"&gt;@hyo_tree&lt;/a&gt;&amp;nbsp;This statement is not correct. Proc Import with the XLSX engine will use the longest string to assign the variable length.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/331278"&gt;@rajd1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below code reads the attached Excel where the longest string for column VarA is in cell A5000 - and it gets it right.&lt;/P&gt;
&lt;P&gt;What happens on your end if you use this code to read the attached Excel?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import 
  out= work.ge 
  datafile= "~/test/test.xlsx"
  dbms=xlsx 
  replace;
  sheet="one";
  getnames=yes;
run;

proc contents data=work.ge;
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 306px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47049iED8F9C15F96930AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 07:49:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668280#M200303</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-07-10T07:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Long Text from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668308#M200315</link>
      <description>thank you . I got it.</description>
      <pubDate>Fri, 10 Jul 2020 09:50:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668308#M200315</guid>
      <dc:creator>hyo_tree</dc:creator>
      <dc:date>2020-07-10T09:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Long Text from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668313#M200316</link>
      <description>Please try scantext option. &lt;BR /&gt;SCANTEXT applies to columns containing text. If SCANTEXT=YES, then SAS will scan the column for the longest string, and uses its length as the column width.</description>
      <pubDate>Fri, 10 Jul 2020 10:08:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668313#M200316</guid>
      <dc:creator>smantha</dc:creator>
      <dc:date>2020-07-10T10:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Long Text from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668347#M200326</link>
      <description>or Try:&lt;BR /&gt;libname x xlsx 'c:\...'    dbmax_text=32767;</description>
      <pubDate>Fri, 10 Jul 2020 12:27:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668347#M200326</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-07-10T12:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Long Text from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668422#M200362</link>
      <description>Thank you this worked&lt;BR /&gt;&lt;BR /&gt;libname db "C:\excel files\test1.xls" mixed=yes;&lt;BR /&gt;data test3;&lt;BR /&gt;set db."Sheet1$"n(DBSASTYPE=(var='char(1024)'));&lt;BR /&gt;run;&lt;BR /&gt;libname db;</description>
      <pubDate>Fri, 10 Jul 2020 17:30:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668422#M200362</guid>
      <dc:creator>newsas007</dc:creator>
      <dc:date>2020-07-10T17:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Long Text from Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668423#M200363</link>
      <description>The Scantext option did not work.</description>
      <pubDate>Fri, 10 Jul 2020 17:30:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Long-Text-from-Excel/m-p/668423#M200363</guid>
      <dc:creator>newsas007</dc:creator>
      <dc:date>2020-07-10T17:30:48Z</dc:date>
    </item>
  </channel>
</rss>

