<?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 use retain statement to fill in IDs and other info? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-retain-statement-to-fill-in-IDs-and-other-info/m-p/969647#M376906</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* UNTESTED CODE */
data have;
 set have;
 id=1;
run;
data want;
  update have(obs=0) have;
  by id;
  output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 25 Jun 2025 01:08:39 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2025-06-25T01:08:39Z</dc:date>
    <item>
      <title>How to use retain statement to fill in IDs and other info?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-retain-statement-to-fill-in-IDs-and-other-info/m-p/969623#M376897</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ginger2_0-1750790805232.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107981i750D31B8AE700262/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ginger2_0-1750790805232.png" alt="ginger2_0-1750790805232.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How to use retain to fill in the missing A and B and C&lt;BR /&gt;Here is the code so far to make this dataset:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data PROD_ALL;&lt;BR /&gt;set _PROD_ALL;&lt;BR /&gt;if B=strip('Subject ID') then delete;&lt;BR /&gt;if missing(G) then delete;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 18:48:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-retain-statement-to-fill-in-IDs-and-other-info/m-p/969623#M376897</guid>
      <dc:creator>ginger2</dc:creator>
      <dc:date>2025-06-24T18:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to use retain statement to fill in IDs and other info?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-retain-statement-to-fill-in-IDs-and-other-info/m-p/969629#M376901</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* UNTESTED CODE */
data want;
    set have;
    retain a1 b1 c1;
    if not missing(a) then a1=a;
    if not missing(b) then b1=b;
    if not missing(c) then c1=c;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code is untested, because we cannot work with data in a screen capture. To get tested code, please provide the data as working SAS data step code (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;instructions and examples&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 20:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-retain-statement-to-fill-in-IDs-and-other-info/m-p/969629#M376901</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-06-24T20:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to use retain statement to fill in IDs and other info?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-retain-statement-to-fill-in-IDs-and-other-info/m-p/969647#M376906</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* UNTESTED CODE */
data have;
 set have;
 id=1;
run;
data want;
  update have(obs=0) have;
  by id;
  output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Jun 2025 01:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-retain-statement-to-fill-in-IDs-and-other-info/m-p/969647#M376906</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-06-25T01:08:39Z</dc:date>
    </item>
  </channel>
</rss>

