<?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 complete blank records with the last period until new period started in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/complete-blank-records-with-the-last-period-until-new-period/m-p/798701#M313983</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope you can help me with this problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;subject daily visit&lt;/P&gt;
&lt;P&gt;101 11aug2021 period 1&lt;/P&gt;
&lt;P&gt;101 12 aug2021 period 1&lt;/P&gt;
&lt;P&gt;101&amp;nbsp; 13aug2021 ---------&amp;gt; period 1&lt;/P&gt;
&lt;P&gt;101 14aug2021 ----------&amp;gt; period 1&lt;/P&gt;
&lt;P&gt;101 15 aug2021 period 2&lt;/P&gt;
&lt;P&gt;101 16 aug2021 period 2&lt;/P&gt;
&lt;P&gt;101 17 aug2021 period 2&lt;/P&gt;
&lt;P&gt;101 18 aug2021 -------&amp;gt; period 2&lt;/P&gt;
&lt;P&gt;101 19 aug2021 period 3&lt;/P&gt;
&lt;P&gt;102 11aug2021 period 1&lt;/P&gt;
&lt;P&gt;102 12 aug2021 period 1&lt;/P&gt;
&lt;P&gt;102&amp;nbsp; 13aug2021 --------&amp;gt;period 1&lt;/P&gt;
&lt;P&gt;102 14aug2021. --------&amp;gt;period 1&lt;/P&gt;
&lt;P&gt;102 15 aug2021 period 2&lt;/P&gt;
&lt;P&gt;102 16 aug2021 period 2&lt;/P&gt;
&lt;P&gt;102 17 aug2021 period 2&lt;/P&gt;
&lt;P&gt;102 18 aug2021 ------&amp;gt; period 2&lt;/P&gt;
&lt;P&gt;102 19 aug2021 period 3&lt;/P&gt;
&lt;P&gt;How can i complete period 1 days 13 and 14, and period 2 day 18,&lt;/P&gt;
&lt;P&gt;basically the blank records (arrow) need to get the value of&amp;nbsp; the previous period until new period start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cuan.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Feb 2022 18:05:19 GMT</pubDate>
    <dc:creator>cuan</dc:creator>
    <dc:date>2022-02-25T18:05:19Z</dc:date>
    <item>
      <title>complete blank records with the last period until new period started</title>
      <link>https://communities.sas.com/t5/SAS-Programming/complete-blank-records-with-the-last-period-until-new-period/m-p/798701#M313983</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope you can help me with this problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;subject daily visit&lt;/P&gt;
&lt;P&gt;101 11aug2021 period 1&lt;/P&gt;
&lt;P&gt;101 12 aug2021 period 1&lt;/P&gt;
&lt;P&gt;101&amp;nbsp; 13aug2021 ---------&amp;gt; period 1&lt;/P&gt;
&lt;P&gt;101 14aug2021 ----------&amp;gt; period 1&lt;/P&gt;
&lt;P&gt;101 15 aug2021 period 2&lt;/P&gt;
&lt;P&gt;101 16 aug2021 period 2&lt;/P&gt;
&lt;P&gt;101 17 aug2021 period 2&lt;/P&gt;
&lt;P&gt;101 18 aug2021 -------&amp;gt; period 2&lt;/P&gt;
&lt;P&gt;101 19 aug2021 period 3&lt;/P&gt;
&lt;P&gt;102 11aug2021 period 1&lt;/P&gt;
&lt;P&gt;102 12 aug2021 period 1&lt;/P&gt;
&lt;P&gt;102&amp;nbsp; 13aug2021 --------&amp;gt;period 1&lt;/P&gt;
&lt;P&gt;102 14aug2021. --------&amp;gt;period 1&lt;/P&gt;
&lt;P&gt;102 15 aug2021 period 2&lt;/P&gt;
&lt;P&gt;102 16 aug2021 period 2&lt;/P&gt;
&lt;P&gt;102 17 aug2021 period 2&lt;/P&gt;
&lt;P&gt;102 18 aug2021 ------&amp;gt; period 2&lt;/P&gt;
&lt;P&gt;102 19 aug2021 period 3&lt;/P&gt;
&lt;P&gt;How can i complete period 1 days 13 and 14, and period 2 day 18,&lt;/P&gt;
&lt;P&gt;basically the blank records (arrow) need to get the value of&amp;nbsp; the previous period until new period start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cuan.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 18:05:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/complete-blank-records-with-the-last-period-until-new-period/m-p/798701#M313983</guid>
      <dc:creator>cuan</dc:creator>
      <dc:date>2022-02-25T18:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: complete blank records with the last period until new period started</title>
      <link>https://communities.sas.com/t5/SAS-Programming/complete-blank-records-with-the-last-period-until-new-period/m-p/798708#M313989</link>
      <description>&lt;P&gt;Basic approach is to create a new variable that you assign the value to and retain it so it is available later.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Untested code as I didn't feel like creating a data step:&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   length holdvisit $ 10; /*&amp;lt;= length should match your exisiting visit value*/
   retain holdvisit;
   if not missing(visit) then holdvisit=visit;
   if missing(visit) then visit=holdvisit;
   /*drop holdvisit; */
run;&lt;/PRE&gt;
&lt;P&gt;Have would be your existing data. The missing function returns true/false (actually 1/0 but used that way) for you existing visit variable so you conditionally assign the retained value. Retain will keep the previous value from a step iteration. After checking that this is working as intended you may want to drop the retained variable Holdvisit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Caution: if any of your SUBJECT values do not have a Visit assigned for the first "visit" this will not work as will assign the last of the previous subject. But you didn't provide that case as an example. It is also a nastier problem.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 18:23:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/complete-blank-records-with-the-last-period-until-new-period/m-p/798708#M313989</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-25T18:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: complete blank records with the last period until new period started</title>
      <link>https://communities.sas.com/t5/SAS-Programming/complete-blank-records-with-the-last-period-until-new-period/m-p/798714#M313992</link>
      <description>&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/p0t2ac0tfzcgbjn112mu96hkgg9o.htm#n0t8n66xgmv06kn1cshe0z8k0dgf" target="_self"&gt;RETAIN Statement&lt;/A&gt;&amp;nbsp;is the way to go&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 18:45:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/complete-blank-records-with-the-last-period-until-new-period/m-p/798714#M313992</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-02-25T18:45:15Z</dc:date>
    </item>
  </channel>
</rss>

