<?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: need to extract information out of a text data field in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348474#M80700</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
infile 'c:\temp\test.csv' lrecl=327678 dlm=',^:|' dsd firstobs=2 truncover;
input id : $100. x : $200. y : $200.@;
do while(not missing(x));
 output;
 input x : $200. y : $200. @;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 09 Apr 2017 03:05:28 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-04-09T03:05:28Z</dc:date>
    <item>
      <title>need to extract information out of a text data field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348438#M80683</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear SAS programming community:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I need to search the contents of a variable "outcome_entries" (please see the attached screenshot of a subject). The actual dataset contains several thousand subjects. I need to collect the values in red color. Note that these values are arranged by outcome_name, followed by the outcome values (where 1 means present of that outcome_name and 0 means absent), followed by the year of that event (which can be missing as in the cva), followed by a number of days value. there is set list of these events (un_ang, ami, cva....) that I know the names. I need: 1) each of these events with its corresponding presence or absence (1/0), date, year, and day since values 2) count how many time a specific event happens (e.g. 2 for "heart" and 2 for "ami", but 1 for "pci" &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;any help is much appreciated, thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; Raymond&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13680i5D48110077EA0659/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screen Shot 2017-04-08 at 2.20.11 PM.png" title="Screen Shot 2017-04-08 at 2.20.11 PM.png" /&gt;</description>
      <pubDate>Sat, 08 Apr 2017 18:31:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348438#M80683</guid>
      <dc:creator>rykwong</dc:creator>
      <dc:date>2017-04-08T18:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: need to extract information out of a text data field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348440#M80684</link>
      <description>In your dataset, which are not assigned red color there are missing values. So you can collect easily the red mark data by using proc sql and also data step method also. How is the dataset saved, is it in in csv?&lt;BR /&gt;</description>
      <pubDate>Sat, 08 Apr 2017 19:01:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348440#M80684</guid>
      <dc:creator>lakshmi_74</dc:creator>
      <dc:date>2017-04-08T19:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: need to extract information out of a text data field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348442#M80685</link>
      <description>&lt;P&gt;thanks for the response&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the data is stored in a flat csv sheet. &amp;nbsp;the actual data is not colored (please see attached screenshot). &amp;nbsp;I just colored the text that I want for the sake of explaining what I need to extract.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;would you have a sas code that shows me how to use proc sql to extract the needed values?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13681iE5A79574B535AF7A/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screen Shot 2017-04-08 at 3.06.37 PM.png" title="Screen Shot 2017-04-08 at 3.06.37 PM.png" /&gt;</description>
      <pubDate>Sat, 08 Apr 2017 19:09:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348442#M80685</guid>
      <dc:creator>rykwong</dc:creator>
      <dc:date>2017-04-08T19:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: need to extract information out of a text data field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348445#M80686</link>
      <description>&lt;P&gt;Not sure what you want your output file to look like, but the following is one way to read and output multiple entries in such a field within a txt file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want (drop=keep_going);
  infile '/folders/myfolders/comments.csv'
    lrecl=32767
    firstobs=2
    dlm='^|';
  informat outcome_name $8.;
  informat outcome_date anydtdte10.;
  format outcome_date date9.;
  keep_going=1;
  do while (keep_going);
    input@'outcome_name:' outcome_name @;
    if missing(outcome_name) then do;
      input;
      keep_going=0;
    end;
    else input @'outcome_value:' outcome_value 
               @'outcome_date:' outcome_date
               @'outcome_date_days_since:' outcome_date_days_since @;
         output;
  end;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Apr 2017 19:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348445#M80686</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-04-08T19:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: need to extract information out of a text data field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348446#M80687</link>
      <description>select outcome_name,outcome_value,outcome_date,outcome_year,outcome_date_days_since&lt;BR /&gt;from have ;&lt;BR /&gt;select count(*),outcome_value,outcome_name from have group by outcome_name,outcome_value;&lt;BR /&gt;</description>
      <pubDate>Sat, 08 Apr 2017 19:43:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348446#M80687</guid>
      <dc:creator>lakshmi_74</dc:creator>
      <dc:date>2017-04-08T19:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: need to extract information out of a text data field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348474#M80700</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
infile 'c:\temp\test.csv' lrecl=327678 dlm=',^:|' dsd firstobs=2 truncover;
input id : $100. x : $200. y : $200.@;
do while(not missing(x));
 output;
 input x : $200. y : $200. @;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 09 Apr 2017 03:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348474#M80700</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-04-09T03:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: need to extract information out of a text data field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348886#M80850</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16220"&gt;@rykwong&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the data is stored in a flat csv sheet. &amp;nbsp;the actual data is not colored (please see attached screenshot). &amp;nbsp;I just colored the text that I want for the sake of explaining what I need to extract.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;would you have a sas code that shows me how to use proc sql to extract the needed values?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're not showing an example of a CSV file. You are showing pictures of (most likely) Excel interpretations of a csv. Since the presence or non-presence of line feed or similar characters is important then perhaps you coult attach, as TEXT file format not PNG, a few example rows. Then we would have something we could actually test code against.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 20:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-extract-information-out-of-a-text-data-field/m-p/348886#M80850</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-10T20:46:54Z</dc:date>
    </item>
  </channel>
</rss>

