<?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: Change the Variable Value Depending on Its other Value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-the-Variable-Value-Depending-on-Its-other-Value/m-p/329630#M73781</link>
    <description>&lt;P&gt;Here's the SQL way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table want as
		select *, max(date) as date_filled
			from have
				group by clientNo;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And a data step way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
	by clientno descending date;
run;

data want_data;
	set have;
	by clientNo;
	retain date_filled;

	if first.clientNo then
		date_filled=date;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 02 Feb 2017 22:50:56 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-02-02T22:50:56Z</dc:date>
    <item>
      <title>Change the Variable Value Depending on Its other Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-Variable-Value-Depending-on-Its-other-Value/m-p/329620#M73773</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to ask a simple question to you. Let's pretend I have two variables and one of them&amp;nbsp;keep records as&amp;nbsp;date values&amp;nbsp;or keep missing values based on CLIENTNO. I want to replace the missing values with date values into same variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can examine my sample data set as below, you can understand my question better.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Have;
Length CLIENTNO 8 DATE $ 20;
Infile Datalines Missover;
Input CLIENTNO DATE;
Datalines;
1 201601
1 201601
1 .
2 .
2 201602
2 .
3 201603
3 201603
3 .
4 201604
4 201604
4 201604
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Desired&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7075i55E05837C416415A/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Desired.png" title="Desired.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or I can also create this desired output in new variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 22:19:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-Variable-Value-Depending-on-Its-other-Value/m-p/329620#M73773</guid>
      <dc:creator>ertr</dc:creator>
      <dc:date>2017-02-02T22:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Change the Variable Value Depending on Its other Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-Variable-Value-Depending-on-Its-other-Value/m-p/329622#M73775</link>
      <description>&lt;P&gt;Can you assume the value of DATE is constant throughout all ClientNo?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 22:31:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-Variable-Value-Depending-on-Its-other-Value/m-p/329622#M73775</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-02T22:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change the Variable Value Depending on Its other Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-Variable-Value-Depending-on-Its-other-Value/m-p/329626#M73779</link>
      <description>&lt;P&gt;I think, I can say. My&amp;nbsp;anticipation is that way.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 22:37:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-Variable-Value-Depending-on-Its-other-Value/m-p/329626#M73779</guid>
      <dc:creator>ertr</dc:creator>
      <dc:date>2017-02-02T22:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Change the Variable Value Depending on Its other Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-Variable-Value-Depending-on-Its-other-Value/m-p/329630#M73781</link>
      <description>&lt;P&gt;Here's the SQL way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table want as
		select *, max(date) as date_filled
			from have
				group by clientNo;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And a data step way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
	by clientno descending date;
run;

data want_data;
	set have;
	by clientNo;
	retain date_filled;

	if first.clientNo then
		date_filled=date;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Feb 2017 22:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-Variable-Value-Depending-on-Its-other-Value/m-p/329630#M73781</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-02T22:50:56Z</dc:date>
    </item>
  </channel>
</rss>

