<?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 How to read data beyond 32767 characters and keep them in a single variable? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310456#M66962</link>
    <description>&lt;P&gt;I am reading data from sas log file row by row and would like to concatinate all rows into single variable.&lt;/P&gt;&lt;P&gt;Can someone let me know the approach that i can read data beyond 32767 character and keep it in dataset variable for my further processing.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Nov 2016 17:23:11 GMT</pubDate>
    <dc:creator>Chery</dc:creator>
    <dc:date>2016-11-09T17:23:11Z</dc:date>
    <item>
      <title>How to read data beyond 32767 characters and keep them in a single variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310456#M66962</link>
      <description>&lt;P&gt;I am reading data from sas log file row by row and would like to concatinate all rows into single variable.&lt;/P&gt;&lt;P&gt;Can someone let me know the approach that i can read data beyond 32767 character and keep it in dataset variable for my further processing.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 17:23:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310456#M66962</guid>
      <dc:creator>Chery</dc:creator>
      <dc:date>2016-11-09T17:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data beyond 32767 characters and keep them in a single variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310462#M66966</link>
      <description>&lt;P&gt;The max length for a char variable in a SAS dataset is 32767. So there is not way to store the contents of a log file into one variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you say more about what you want to do, there might be different solutions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 17:36:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310462#M66966</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-11-09T17:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data beyond 32767 characters and keep them in a single variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310481#M66980</link>
      <description>&lt;P&gt;Thanks Bruno for your quick respone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you advise how to handle this situation?. If we split into two variables and later concatenate them&amp;nbsp;and generate a external file (.csv) with more than 32k will it possible?.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our requirement is to generate a external csv file with all the values in a single variable might fall beyond 32 K length.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pleaes advise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Cheers...&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 18:37:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310481#M66980</guid>
      <dc:creator>Chery</dc:creator>
      <dc:date>2016-11-09T18:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data beyond 32767 characters and keep them in a single variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310490#M66989</link>
      <description>&lt;P&gt;Forget it. Log files are in another order of magnitude. Ours routinely reach megabyte sizes.&lt;/P&gt;
&lt;P&gt;If you want to create a database of logs, put path/filenames into the dataset and create a report with links to the files.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 19:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310490#M66989</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-09T19:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data beyond 32767 characters and keep them in a single variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310508#M66996</link>
      <description>&lt;P&gt;Ugly but you &lt;STRONG&gt;may&lt;/STRONG&gt; be able to fool things depending on operating systems involved. For instance the in Windows if you create a csv file by default each record ends in a Carriage-Return Line-Feed pair of characters. You can, when writing data to a file you can specify a different record terminatior using the TERMSTR option on the file statement. So if you use TERMSTR=LF for instance it misses the carriage return and a WINDOWS system will think it is part of the same record though it will appear on a different line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I am having a hard time finding a valid reason to stuff that much text into a single CSV column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note, if you are intendent to add other variables the above may not be viable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what kind of processing?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 20:07:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310508#M66996</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-11-09T20:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data beyond 32767 characters and keep them in a single variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310512#M66998</link>
      <description>&lt;P&gt;Hi Kurt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your advise. Let me explain the requirement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Read sas logs into sas system and create dataset&lt;/P&gt;&lt;P&gt;2. While reading into sas system I am splitting the log into blocks based on cpu time... Means I am reading a log from starting position to till it reaches to cpu time as I am&amp;nbsp;considering as a block. It contains the the atual code and and related information as well. For ex. if the&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log contains 4 times cpu time , my code will split the log into 4 blocks.( starting position to till cpu time as a block). In this situation some times log maybe huge and have length more than 32k ... I am facing issue here.&lt;/P&gt;&lt;P&gt;3. Need to analyze each block and need to populate some values like block,number of observations, target table , source table ..etc..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise if you have any solution for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 20:37:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310512#M66998</guid>
      <dc:creator>Chery</dc:creator>
      <dc:date>2016-11-09T20:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data beyond 32767 characters and keep them in a single variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310524#M67000</link>
      <description>&lt;P&gt;If your aim is to track application reponse and such you might look into the ARM facility.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 21:08:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310524#M67000</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-11-09T21:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to read data beyond 32767 characters and keep them in a single variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310592#M67012</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/109308"&gt;@Chery&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi Kurt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your advise. Let me explain the requirement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Read sas logs into sas system and create dataset&lt;/P&gt;
&lt;P&gt;2. While reading into sas system I am splitting the log into blocks based on cpu time... Means I am reading a log from starting position to till it reaches to cpu time as I am&amp;nbsp;considering as a block. It contains the the atual code and and related information as well. For ex. if the&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log contains 4 times cpu time , my code will split the log into 4 blocks.( starting position to till cpu time as a block). In this situation some times log maybe huge and have length more than 32k ... I am facing issue here.&lt;/P&gt;
&lt;P&gt;3. Need to analyze each block and need to populate some values like block,number of observations, target table , source table ..etc..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise if you have any solution for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'd rather read the log line by line and save the data everytime a step boundary appears.&lt;/P&gt;
&lt;P&gt;Basically collect data into RETAINed variables, and once a proc or data statement appears, write the record out and reset the variables to empty/missing to start a new cycle.&lt;/P&gt;
&lt;P&gt;Or you could simply only parse the NOTE: lines that conclude every step.&lt;/P&gt;
&lt;P&gt;After that you can cumulate statistics for a given time window.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 08:45:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-data-beyond-32767-characters-and-keep-them-in-a/m-p/310592#M67012</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-10T08:45:54Z</dc:date>
    </item>
  </channel>
</rss>

