<?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: retain values in sequential order starting from zero by dose in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/retain-values-in-sequential-order-starting-from-zero-by-dose/m-p/768878#M243893</link>
    <description>&lt;P&gt;Providing data as a screen capture isn't helpful, as we can't run code against a screen capture. The proper way to provide data is in a SAS data step, instructions are here:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Saying "it doesn't work" doesn't help either. We need details, we need your data, we need to see your code. What about it doesn't work? Is there an error in the log?&amp;nbsp;We will need to see your log in order to diagnose errors in the log. Or if the output wrong, if so please show us and explain.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Sep 2021 16:20:04 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-09-21T16:20:04Z</dc:date>
    <item>
      <title>retain values in sequential order starting from zero by dose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/retain-values-in-sequential-order-starting-from-zero-by-dose/m-p/768795#M243880</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create reduce variable from below data, reduce value starts from 0 and increases if any reduction in dose and retains tilll next reduction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data like below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anyalamadugu_0-1632238026857.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63805iA8A70253A25F0C62/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anyalamadugu_0-1632238026857.png" alt="anyalamadugu_0-1632238026857.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone provide the logic for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Adi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 15:27:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/retain-values-in-sequential-order-starting-from-zero-by-dose/m-p/768795#M243880</guid>
      <dc:creator>chinna0369</dc:creator>
      <dc:date>2021-09-21T15:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: retain values in sequential order starting from zero by dose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/retain-values-in-sequential-order-starting-from-zero-by-dose/m-p/768797#M243882</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data want;
    set have;
    by id;
    if first.id then reduce=0;
    reduce+(dif(dose)&amp;lt;0 and not first.id);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Sep 2021 14:32:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/retain-values-in-sequential-order-starting-from-zero-by-dose/m-p/768797#M243882</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-09-21T14:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: retain values in sequential order starting from zero by dose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/retain-values-in-sequential-order-starting-from-zero-by-dose/m-p/768825#M243889</link>
      <description>&lt;P&gt;Somehow this is not working with my data, is there any other way?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 15:14:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/retain-values-in-sequential-order-starting-from-zero-by-dose/m-p/768825#M243889</guid>
      <dc:creator>chinna0369</dc:creator>
      <dc:date>2021-09-21T15:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: retain values in sequential order starting from zero by dose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/retain-values-in-sequential-order-starting-from-zero-by-dose/m-p/768878#M243893</link>
      <description>&lt;P&gt;Providing data as a screen capture isn't helpful, as we can't run code against a screen capture. The proper way to provide data is in a SAS data step, instructions are here:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Saying "it doesn't work" doesn't help either. We need details, we need your data, we need to see your code. What about it doesn't work? Is there an error in the log?&amp;nbsp;We will need to see your log in order to diagnose errors in the log. Or if the output wrong, if so please show us and explain.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 16:20:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/retain-values-in-sequential-order-starting-from-zero-by-dose/m-p/768878#M243893</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-09-21T16:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: retain values in sequential order starting from zero by dose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/retain-values-in-sequential-order-starting-from-zero-by-dose/m-p/768883#M243896</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117414"&gt;@chinna0369&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Somehow this is not working with my data, is there any other way?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Provide example data in usable form. Post your data as a data step with datalines, as I showed you &lt;A href="https://communities.sas.com/t5/SAS-Programming/Assign-sequence-based-dose-starting-from-zero/m-p/768880/highlight/true#M243894" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We cannot code and test against pictures, we need usable data. &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;DO NOT SKIP THE ABOVE.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 16:23:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/retain-values-in-sequential-order-starting-from-zero-by-dose/m-p/768883#M243896</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-21T16:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: retain values in sequential order starting from zero by dose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/retain-values-in-sequential-order-starting-from-zero-by-dose/m-p/768884#M243897</link>
      <description>&lt;P&gt;Also, please don't post the same question more than once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From this point forward, all discussion of this question should be in your other thread at&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Assign-sequence-based-dose-starting-from-zero/m-p/768687#M243836" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Assign-sequence-based-dose-starting-from-zero/m-p/768687#M243836&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will not discuss this topic further in this thread, all comments should go to the other thread.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 16:24:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/retain-values-in-sequential-order-starting-from-zero-by-dose/m-p/768884#M243897</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-09-21T16:24:01Z</dc:date>
    </item>
  </channel>
</rss>

