<?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: Help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help/m-p/540911#M149271</link>
    <description>&lt;P&gt;Try using a lag variable. I have not tested it but how about something like;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=have;&lt;/P&gt;&lt;P&gt;by id parity;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;new_variable=lag(weaning_date);&lt;/P&gt;&lt;P&gt;if first.id then new_variable=.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Mar 2019 20:13:07 GMT</pubDate>
    <dc:creator>Tommy1</dc:creator>
    <dc:date>2019-03-06T20:13:07Z</dc:date>
    <item>
      <title>Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help/m-p/540905#M149268</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a large data set with ID, PARITY, BREEDING DATE, FARROWING DATE AND WEANING DATE variables. I need to&amp;nbsp;create a new variable that can show the weaning date of the previous&amp;nbsp;PARITY&amp;nbsp;within the same&amp;nbsp;ID. In all&amp;nbsp;PARITY 1 I need a&amp;nbsp;"." in the&amp;nbsp;NEW VARIABLE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I need to achieve:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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="Image.png" style="width: 557px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27718iCE4D11CCC105350D/image-dimensions/557x313?v=v2" width="557" height="313" role="button" title="Image.png" alt="Image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any help provided will be greatly appreciated!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Francisco&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 19:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help/m-p/540905#M149268</guid>
      <dc:creator>Francisco_Cab</dc:creator>
      <dc:date>2019-03-06T19:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help/m-p/540911#M149271</link>
      <description>&lt;P&gt;Try using a lag variable. I have not tested it but how about something like;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=have;&lt;/P&gt;&lt;P&gt;by id parity;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;new_variable=lag(weaning_date);&lt;/P&gt;&lt;P&gt;if first.id then new_variable=.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 20:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help/m-p/540911#M149271</guid>
      <dc:creator>Tommy1</dc:creator>
      <dc:date>2019-03-06T20:13:07Z</dc:date>
    </item>
  </channel>
</rss>

