<?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: Importing a file with characters more than 32000 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Importing-a-file-with-characters-more-than-32000/m-p/912941#M359855</link>
    <description>&lt;P&gt;Without having tried, I would use a second input variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input @1 banner $32000. @32001 banner2 $32000.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 25 Jan 2024 06:58:34 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2024-01-25T06:58:34Z</dc:date>
    <item>
      <title>Importing a file with characters more than 32000</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-a-file-with-characters-more-than-32000/m-p/912940#M359854</link>
      <description>Hello! I need to import a txt file with a column that exceeds 32000. This is a simplified version of my code. Sorry i’m using my phone since I can’t use my work laptop to login here. &lt;BR /&gt;&lt;BR /&gt;%macro import(file)&lt;BR /&gt;Data file;&lt;BR /&gt;infile “/abc/defg/&amp;amp;file” truncover lrecl=32000;&lt;BR /&gt;input @1 banner $32000.;&lt;BR /&gt;data file;set file;&lt;BR /&gt;Enum=substr(banner,43,9);&lt;BR /&gt;Run;&lt;BR /&gt;%mend import;&lt;BR /&gt;&lt;BR /&gt;How do I make banner spill to another column say banner2 if characters are more than 32000?&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Jan 2024 06:52:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-a-file-with-characters-more-than-32000/m-p/912940#M359854</guid>
      <dc:creator>JT99</dc:creator>
      <dc:date>2024-01-25T06:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a file with characters more than 32000</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-a-file-with-characters-more-than-32000/m-p/912941#M359855</link>
      <description>&lt;P&gt;Without having tried, I would use a second input variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input @1 banner $32000. @32001 banner2 $32000.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Jan 2024 06:58:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-a-file-with-characters-more-than-32000/m-p/912941#M359855</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2024-01-25T06:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a file with characters more than 32000</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-a-file-with-characters-more-than-32000/m-p/912943#M359857</link>
      <description>&lt;P&gt;If there is more than 32k data in single line, you also probably want to increase the "&lt;SPAN&gt;lrecl=&lt;/SPAN&gt;" to something bigger than 32k, e.g. "&lt;SPAN&gt;lrecl=1000000;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Bart&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 07:52:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-a-file-with-characters-more-than-32000/m-p/912943#M359857</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-01-25T07:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a file with characters more than 32000</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-a-file-with-characters-more-than-32000/m-p/912977#M359866</link>
      <description>&lt;P&gt;IF you have access to a Viya 4 environment then you could load the .csv into a CAS table where you've got data type varchar(*) that can store more than 32KB characters.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 13:21:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-a-file-with-characters-more-than-32000/m-p/912977#M359866</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-01-25T13:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a file with characters more than 32000</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-a-file-with-characters-more-than-32000/m-p/912994#M359870</link>
      <description>&lt;P&gt;You don't seem to be "importing" anything.&amp;nbsp; You appear to just want to READ a text file.&lt;/P&gt;
&lt;P&gt;For example to read up to 5*32000 bytes from each line into 5 character variables just do something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile 'myfile' lrecl=1000000 truncover;
  input (var1-var5) ($char32000.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the lines are varying length it will probably save space and be easier to work with if you read the text into multiple observations.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile 'myfile' lrecl=1000000 length=ll colum=cc truncover;
  row+1;
  do col=1 by 1 until(cc&amp;gt;ll);
    input string $char32000. @;
    output;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Jan 2024 15:31:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-a-file-with-characters-more-than-32000/m-p/912994#M359870</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-01-25T15:31:35Z</dc:date>
    </item>
  </channel>
</rss>

