<?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: How to extract a specific text from each cell from the same variable/column? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-obtain-some-words-from-a-variable/m-p/748897#M235282</link>
    <description>&lt;P&gt;Dear ballardw,&lt;BR /&gt;&lt;BR /&gt;My final result for "observation1 variable" initially is to obtain information from each line.&lt;BR /&gt;For example, I would like these "multiple types, including h1, H3 and N1. &lt;BR /&gt;So, if I have this result counting as you mention. Later, I can transform it into an outcome like "h1, H3 and N1" or "N1" in case of the other result.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance again,&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;/P&gt;</description>
    <pubDate>Fri, 18 Jun 2021 14:15:56 GMT</pubDate>
    <dc:creator>Moraes86</dc:creator>
    <dc:date>2021-06-18T14:15:56Z</dc:date>
    <item>
      <title>How to obtain some words from a variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-obtain-some-words-from-a-variable/m-p/748938#M235280</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wish to extract some words from the variable observation.&lt;/P&gt;
&lt;P&gt;My goal is to extract these words (such as "&amp;nbsp;H1", "N1")&amp;nbsp; from the variable (observation) to the variable observation1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks all in advance,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So my data is described below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test2; set test2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;user&lt;/TD&gt;
&lt;TD&gt;Observation&lt;/TD&gt;
&lt;TD&gt;observation1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;367&lt;/TD&gt;
&lt;TD&gt;sample type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; indicated the presence of subtype H1. However,&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;H1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1427&lt;/TD&gt;
&lt;TD&gt;sample type&amp;nbsp; indicated the presence of subtype H1. However, the&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;H1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3046&lt;/TD&gt;
&lt;TD&gt;sample type&amp;nbsp; this case and indicated the presence of&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;multiple types, including H1, H3, N1, and N2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;H1, H3 and N1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3146&lt;/TD&gt;
&lt;TD&gt;sample&amp;nbsp; type and indicated the presence of&amp;nbsp; &amp;nbsp; multiple types, including H1, H3, N1, and N2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;H1, H3, N1, and N2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;8910&lt;/TD&gt;
&lt;TD&gt;sample type (H,N)&amp;nbsp; fluid&amp;nbsp; &amp;nbsp; indicated the presence of&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; multiple types, including H1, H3 and N2.&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;H1, H3 and N2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;9091&lt;/TD&gt;
&lt;TD&gt;sample type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; indicated the presence of type N1.&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;N1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 18 Jun 2021 16:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-obtain-some-words-from-a-variable/m-p/748938#M235280</guid>
      <dc:creator>Moraes86</dc:creator>
      <dc:date>2021-06-18T16:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a specific text from each cell from the same variable/column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-obtain-some-words-from-a-variable/m-p/748897#M235282</link>
      <description>&lt;P&gt;Dear ballardw,&lt;BR /&gt;&lt;BR /&gt;My final result for "observation1 variable" initially is to obtain information from each line.&lt;BR /&gt;For example, I would like these "multiple types, including h1, H3 and N1. &lt;BR /&gt;So, if I have this result counting as you mention. Later, I can transform it into an outcome like "h1, H3 and N1" or "N1" in case of the other result.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance again,&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 14:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-obtain-some-words-from-a-variable/m-p/748897#M235282</guid>
      <dc:creator>Moraes86</dc:creator>
      <dc:date>2021-06-18T14:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to obtain some words from a variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-obtain-some-words-from-a-variable/m-p/748939#M235281</link>
      <description>I think if it was me, I would use prxmatch to make indicator variables and then do an array of those and concatenate the array to show what was in there.</description>
      <pubDate>Fri, 18 Jun 2021 17:09:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-obtain-some-words-from-a-variable/m-p/748939#M235281</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-06-18T17:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to obtain some words from a variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-obtain-some-words-from-a-variable/m-p/748970#M235286</link>
      <description>&lt;P&gt;Please try this:&lt;/P&gt;&lt;P&gt;data test_1;&lt;BR /&gt;set test;&lt;BR /&gt;length word $32. Observation_1 $72.;&lt;BR /&gt;delims = " =;,.()&amp;lt;&amp;gt;/'"; /* delimiters: space, comma, period, ... */&lt;BR /&gt;numWords = countw(Observation, delims); /* determining how many words in the text */&lt;BR /&gt;Observation_1='';&lt;BR /&gt;do i = 1 to numWords; /* split text into words */&lt;BR /&gt;word = scan(Observation, i, delims);&lt;BR /&gt;if compress(word) in ('H1', 'H2', 'H3', 'N1', 'N2') then&lt;BR /&gt;Observation_1=trim(Observation_1)||compress(word)||',';&lt;BR /&gt;end;&lt;BR /&gt;Observation_1=substr(compress(Observation_1), 1, length(compress(Observation_1))-1);&lt;BR /&gt;keep user Observation Observation_1;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 18:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-obtain-some-words-from-a-variable/m-p/748970#M235286</guid>
      <dc:creator>Jerrya00</dc:creator>
      <dc:date>2021-06-18T18:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to obtain some words from a variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-obtain-some-words-from-a-variable/m-p/748977#M235291</link>
      <description>&lt;P&gt;Hi Jerrya00,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It worked very well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks all for the valuable help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 18:52:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-obtain-some-words-from-a-variable/m-p/748977#M235291</guid>
      <dc:creator>Moraes86</dc:creator>
      <dc:date>2021-06-18T18:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a specific text from each cell from the same variable/column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-obtain-some-words-from-a-variable/m-p/749014#M235314</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/375564"&gt;@Moraes86&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Dear ballardw,&lt;BR /&gt;&lt;BR /&gt;My final result for "observation1 variable" initially is to obtain information from each line.&lt;BR /&gt;For example, I would like these "multiple types, including h1, H3 and N1. &lt;BR /&gt;So, if I have this result counting as you mention. Later, I can transform it into an outcome like "h1, H3 and N1" or "N1" in case of the other result.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance again,&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And this is exactly why we request that you do not post duplicate questions. I asked a question in the OTHER thread &lt;A href="https://communities.sas.com/t5/SAS-Programming/How-to-extract-a-specific-text-from-each-cell-from-the-same/m-p/748781" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/How-to-extract-a-specific-text-from-each-cell-from-the-same/m-p/748781&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and you "answer" it here. Actually still haven't answered it because the question was about how consistent your text actually is, and how the *bleep* you are going to use the resulting variable.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 02:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-obtain-some-words-from-a-variable/m-p/749014#M235314</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-06-19T02:38:34Z</dc:date>
    </item>
  </channel>
</rss>

