<?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 replace values between columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617293#M180860</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304931"&gt;@superbug&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this ??&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test_;
	set test;
	if 0=&amp;lt;peat1=&amp;lt;6 and peat1 ^=. then peat1_=1;
	if 0=&amp;lt;peat2=&amp;lt;6 and peat2 ^=. then do;
		peat2_= 1;
		peat1 = 1;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jan 2020 19:53:15 GMT</pubDate>
    <dc:creator>ed_sas_member</dc:creator>
    <dc:date>2020-01-14T19:53:15Z</dc:date>
    <item>
      <title>How to replace values between columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617286#M180856</link>
      <description>&lt;P&gt;my data is like this&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;infile cards truncover;&lt;BR /&gt;input peat1 peat2;&lt;BR /&gt;datalines;&lt;BR /&gt;0 .&lt;BR /&gt;3 .&lt;BR /&gt;6 .&lt;BR /&gt;24 6&lt;BR /&gt;15 .&lt;BR /&gt;18 0&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;use the following code, I generated two new variables, peat1_ and peat2_.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test_;&lt;BR /&gt;set test;&lt;BR /&gt;if 0=&amp;lt;peat1=&amp;lt;6 and peat1 ^=. then peat1_=1;&lt;/P&gt;&lt;P&gt;if 0=&amp;lt;peat2=&amp;lt;6 and peat2 ^=. then peat2_=1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I want to replace values of peat1 with values of peat2_, which SAS function should I use? thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 19:17:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617286#M180856</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2020-01-14T19:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace values between columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617293#M180860</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304931"&gt;@superbug&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this ??&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test_;
	set test;
	if 0=&amp;lt;peat1=&amp;lt;6 and peat1 ^=. then peat1_=1;
	if 0=&amp;lt;peat2=&amp;lt;6 and peat2 ^=. then do;
		peat2_= 1;
		peat1 = 1;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 19:53:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617293#M180860</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-01-14T19:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace values between columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617304#M180866</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292097"&gt;@ed_sas_member&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks. using the code you suggested, the original value of peat1 changed in row 4 and row 6, which is not I wanted.&lt;/P&gt;&lt;P&gt;Also, there's is no difference on peat1_ and peat2_ variables using your code&amp;nbsp; and using my original code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 20:25:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617304#M180866</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2020-01-14T20:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace values between columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617307#M180868</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304931"&gt;@superbug&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please provide the expected output as it's not clear to me.&lt;/P&gt;
&lt;P&gt;According to the IF condition you provided, there is no difference in calculation. I believe there is a mistake somewhere.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 20:41:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617307#M180868</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-01-14T20:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace values between columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617421#M180926</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if not missing(peat2_) then peat1=peat2_;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jan 2020 12:59:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617421#M180926</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2020-01-15T12:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace values between columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617440#M180940</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292097"&gt;@ed_sas_member&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I restructured my data. I'll consider to reach my final results in another way.&lt;/P&gt;&lt;P&gt;Thanks much for your time!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 14:06:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617440#M180940</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2020-01-15T14:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace values between columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617442#M180941</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/77163"&gt;@Oligolas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 14:11:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-values-between-columns/m-p/617442#M180941</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2020-01-15T14:11:40Z</dc:date>
    </item>
  </channel>
</rss>

