<?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 Better subject line needed in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Count-variable-value-changes/m-p/859172#M10821</link>
    <description>&lt;P&gt;Please go back to your ORIGINAL post and provide a subject line that describes the problem. A subject line of "SAS Code" could apply to 99% of the posts here, and so has no value in describing the problem. Help us out, please; we're trying to help you.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Feb 2023 12:15:56 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-02-16T12:15:56Z</dc:date>
    <item>
      <title>Count variable value changes</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Count-variable-value-changes/m-p/859159#M10818</link>
      <description>&lt;P&gt;Help me find solutions for below problem&lt;BR /&gt;Date. Newkey. Flag&lt;BR /&gt;Dec16. 13. 0&lt;BR /&gt;Jan17. 13. 1&lt;BR /&gt;Feb17. 13. 1&lt;BR /&gt;Mar17. 13. 1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Need to find total cases as to how many times the flag switched from 0 to 1 in above table&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 08:47:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Count-variable-value-changes/m-p/859159#M10818</guid>
      <dc:creator>Madhav4114</dc:creator>
      <dc:date>2023-02-17T08:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Count-variable-value-changes/m-p/859162#M10819</link>
      <description>&lt;P&gt;What does your desired result look like?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 11:12:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Count-variable-value-changes/m-p/859162#M10819</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2023-02-16T11:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Count-variable-value-changes/m-p/859164#M10820</link>
      <description>&lt;P&gt;Not tested (pop test data in the form of a data step please):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  retain num_times 0;
  if lag(flag)=0 and flag=1 then num_times=sum(num_times,1);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Last record would have your total number of times.&amp;nbsp; You could also do it via sql to join lowest previous date to current record as well.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 11:19:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Count-variable-value-changes/m-p/859164#M10820</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2023-02-16T11:19:59Z</dc:date>
    </item>
    <item>
      <title>Better subject line needed</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Count-variable-value-changes/m-p/859172#M10821</link>
      <description>&lt;P&gt;Please go back to your ORIGINAL post and provide a subject line that describes the problem. A subject line of "SAS Code" could apply to 99% of the posts here, and so has no value in describing the problem. Help us out, please; we're trying to help you.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 12:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Count-variable-value-changes/m-p/859172#M10821</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-02-16T12:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Count variable value changes</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Count-variable-value-changes/m-p/864471#M10863</link>
      <description>&lt;P&gt;If you just need the count, you can do like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  retain count -1; /* the first record should set count to 0 */
  set have end=done;
  by flag notsorted;
  count+first.flag;
  if done;
  keep count;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Mar 2023 08:32:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Count-variable-value-changes/m-p/864471#M10863</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2023-03-16T08:32:37Z</dc:date>
    </item>
  </channel>
</rss>

