<?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 remove variable from array if it contains missing values? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874110#M345324</link>
    <description>&lt;P&gt;Once a variable is declared to be in an array, it is in the array, I don't think you can remove it during the same data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps you could explain the bigger picture, what you are doing, why you are doing it, what removing from array really means,&amp;nbsp;&lt;EM&gt;etc&lt;/EM&gt;. ?&lt;/P&gt;</description>
    <pubDate>Fri, 05 May 2023 11:31:59 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-05-05T11:31:59Z</dc:date>
    <item>
      <title>How to remove variable from array if it contains missing values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874108#M345322</link>
      <description />
      <pubDate>Fri, 05 May 2023 11:18:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874108#M345322</guid>
      <dc:creator>lovecoding</dc:creator>
      <dc:date>2023-05-05T11:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove variable from array if it contains missing values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874110#M345324</link>
      <description>&lt;P&gt;Once a variable is declared to be in an array, it is in the array, I don't think you can remove it during the same data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps you could explain the bigger picture, what you are doing, why you are doing it, what removing from array really means,&amp;nbsp;&lt;EM&gt;etc&lt;/EM&gt;. ?&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 11:31:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874110#M345324</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-05T11:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove variable from array if it contains missing values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874111#M345329</link>
      <description>&lt;P&gt;Can you provide more details this is somewhat vague&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 11:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874111#M345329</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2023-05-05T11:35:12Z</dc:date>
    </item>
    <item>
      <title>From the dataset keep only those variables that are not missing in all observations using arrays.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874121#M345334</link>
      <description>&lt;PRE&gt;From the dataset keep only those variables that are not missing in all observations. 

data temp;

input var1-var6;
	
datalines;
	1 2 3 4 5 6
	. 1 2 3 4 6
	. . 2 0 . 6
	4 5 6 7 8 6
	1 . 3 4 . 6
;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 May 2023 12:42:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874121#M345334</guid>
      <dc:creator>lovecoding</dc:creator>
      <dc:date>2023-05-05T12:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: From the dataset keep only those variables that are not missing in all observations using arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874124#M345337</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
input var1-var6;
datalines;
	1 2 3 4 5 6
	. 1 2 3 4 6
	. . 2 0 . 6
	4 5 6 7 8 6
	1 . 3 4 . 6
;
run;

data _null_;
set temp end=EOF;
array v var1-var6;
array N null1-null6;

do over v;
  if missing(v) then n=1;
end;

if EOF then
  do;
    call execute("data new_temp; set temp(drop=");
    do over v;
      if n then call execute(vname(v));
    end;
    call execute("); run;");
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 May 2023 12:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874124#M345337</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-05-05T12:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: From the dataset keep only those variables that are not missing in all observations using arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874125#M345338</link>
      <description>&lt;P&gt;So this really has nothing to do with arrays? Just remove a variable from the data set (not from the array) if it has a missing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=temp;
    var var1-var6;
    output out=stats nmiss=;
run;
proc transpose data=stats(drop=_type_ _freq_) out=stats1;
run;    
proc sql noprint;
    select distinct _name_ into :names separated by ' ' from stats1 where col1=0;
quit;
data want;
    set temp(keep=&amp;amp;names);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 May 2023 13:34:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874125#M345338</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-05T13:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: From the dataset keep only those variables that are not missing in all observations using arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874285#M345411</link>
      <description>Does not corectly worke,becouse you take only last row to determine missings</description>
      <pubDate>Sat, 06 May 2023 18:59:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874285#M345411</guid>
      <dc:creator>Davit198</dc:creator>
      <dc:date>2023-05-06T18:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: From the dataset keep only those variables that are not missing in all observations using arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874287#M345412</link>
      <description>&lt;P&gt;Right, should be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if missing(v) then n+1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;instead `n=1`.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2023 19:06:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874287#M345412</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-05-06T19:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove variable from array if it contains missing values?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874320#M345425</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
input var1-var6;
datalines;
	1 2 3 4 5 6
	. 1 2 3 4 6
	. . 2 0 . 6
	4 5 6 7 8 6
	1 . 3 4 . 6
;
run;

ods select none;
ods output nlevels=nlevels;
proc freq data=temp nlevels;
table _all_;
run;
ods select all;

proc sql noprint;
select TableVar into :keep separated by ' ' from nlevels where NMissLevels=0;
quit;

data want;
 set temp;
 keep &amp;amp;keep.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 May 2023 09:33:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-variable-from-array-if-it-contains-missing-values/m-p/874320#M345425</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-05-07T09:33:03Z</dc:date>
    </item>
  </channel>
</rss>

