<?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: deleting variable values based on another variable value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/deleting-variable-values-based-on-another-variable-value/m-p/306675#M65607</link>
    <description>&lt;P&gt;CALL MISSING()&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p1iq436yh8838rn1ud38om45n99k.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p1iq436yh8838rn1ud38om45n99k.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code doesn't care if diff and variables are character or numeric.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if missing(diff) then call missing(of variables(*));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Oct 2016 02:34:35 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-10-24T02:34:35Z</dc:date>
    <item>
      <title>deleting variable values based on another variable value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/deleting-variable-values-based-on-another-variable-value/m-p/306667#M65604</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;suppose I have the variable diff and 5 other variables (among many others) a,b,c,d,e.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Whenever the diff = '' I want also the other 5 variabels also be =''.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
set have;
array variables[5] 
a b c d e;
if diff = '' then
do i = 1 to 5
 variables[i]= '';
end;
drop i ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But get errors... I guess that the logic of my syntax isn't correct, although I tried to do some modifications of the code and still get errors. Could you please help me?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 23 Oct 2016 22:52:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/deleting-variable-values-based-on-another-variable-value/m-p/306667#M65604</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2016-10-23T22:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: deleting variable values based on another variable value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/deleting-variable-values-based-on-another-variable-value/m-p/306669#M65605</link>
      <description>&lt;P&gt;I think I got it: I should have put the if statement inside the do statament:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
set have;
array variables[5]
a b c d e;
do i = 1 to 5;
if diff ='' then variables[i] = '';
end;
drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But if there is a better way I will be very happy to learn!!!&lt;/P&gt;</description>
      <pubDate>Sun, 23 Oct 2016 23:08:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/deleting-variable-values-based-on-another-variable-value/m-p/306669#M65605</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2016-10-23T23:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: deleting variable values based on another variable value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/deleting-variable-values-based-on-another-variable-value/m-p/306675#M65607</link>
      <description>&lt;P&gt;CALL MISSING()&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p1iq436yh8838rn1ud38om45n99k.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p1iq436yh8838rn1ud38om45n99k.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code doesn't care if diff and variables are character or numeric.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if missing(diff) then call missing(of variables(*));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 02:34:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/deleting-variable-values-based-on-another-variable-value/m-p/306675#M65607</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-24T02:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: deleting variable values based on another variable value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/deleting-variable-values-based-on-another-variable-value/m-p/306677#M65608</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
set have;
array variables[5] a b c d e;

if diff ='' then call missing(of variables[*]);

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Oct 2016 02:39:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/deleting-variable-values-based-on-another-variable-value/m-p/306677#M65608</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-24T02:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: deleting variable values based on another variable value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/deleting-variable-values-based-on-another-variable-value/m-p/306751#M65620</link>
      <description>&lt;P&gt;While you have some valid suggestions here, your original problem was a missing semicolon:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 to 5 &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 11:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/deleting-variable-values-based-on-another-variable-value/m-p/306751#M65620</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-10-24T11:16:52Z</dc:date>
    </item>
  </channel>
</rss>

