<?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: finding first non missing variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/finding-first-non-missing-variable/m-p/308461#M66201</link>
    <description>&lt;P&gt;Making sample data that doesn't reflect your situation means having to answer your question twice.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Youll have to loop through the array then to find your first non missing value. You can use LEAVE to exit a loop.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VNAME can still be used to find variable name and _n_ for row number. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Nov 2016 09:12:44 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-11-01T09:12:44Z</dc:date>
    <item>
      <title>finding first non missing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-first-non-missing-variable/m-p/308451#M66194</link>
      <description>&lt;P&gt;&amp;nbsp;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have data like below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;input a b c;&lt;BR /&gt;datalines;&lt;BR /&gt;1 0 0&lt;BR /&gt;0 1 0&lt;BR /&gt;0 1 1&lt;BR /&gt;1 1 1&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need output with same data added one more variable result as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a b c Result&lt;/P&gt;&lt;P&gt;1 0 0 A1&lt;/P&gt;&lt;P&gt;0 1 0 B2&lt;/P&gt;&lt;P&gt;0 1 1 B3&lt;/P&gt;&lt;P&gt;1 1 1 A4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please suggest to get the result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 08:35:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-first-non-missing-variable/m-p/308451#M66194</guid>
      <dc:creator>Aman4SAS</dc:creator>
      <dc:date>2016-11-01T08:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: finding first non missing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-first-non-missing-variable/m-p/308452#M66195</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you post the code you tried and / or describe what are the diificulties of building your own solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 08:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-first-non-missing-variable/m-p/308452#M66195</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2016-11-01T08:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: finding first non missing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-first-non-missing-variable/m-p/308454#M66196</link>
      <description>&lt;P&gt;I am not able to imageing anything on it or i can try array and "if " conditions but its not seems good. Can u please suggest if any thing in sort available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 08:47:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-first-non-missing-variable/m-p/308454#M66196</guid>
      <dc:creator>Aman4SAS</dc:creator>
      <dc:date>2016-11-01T08:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: finding first non missing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-first-non-missing-variable/m-p/308456#M66197</link>
      <description>&lt;P&gt;Your last component appears to be the row and independent of the variable. You can get the row nimbler by using _n_.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You say first non missing value but you don't have any missing values in your data set.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use WHICHN and VNAME to find the variable name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Array var_list(3) a b c;

Index = whichn(1, of var_list(*));
First_var = vname(var_list(index));
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Nov 2016 08:55:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-first-non-missing-variable/m-p/308456#M66197</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-01T08:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: finding first non missing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-first-non-missing-variable/m-p/308459#M66200</link>
      <description>&lt;P&gt;0 as missing value and 1 can be anything.. just to simplify i used 0 and 1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 08:58:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-first-non-missing-variable/m-p/308459#M66200</guid>
      <dc:creator>Aman4SAS</dc:creator>
      <dc:date>2016-11-01T08:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: finding first non missing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-first-non-missing-variable/m-p/308461#M66201</link>
      <description>&lt;P&gt;Making sample data that doesn't reflect your situation means having to answer your question twice.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Youll have to loop through the array then to find your first non missing value. You can use LEAVE to exit a loop.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VNAME can still be used to find variable name and _n_ for row number. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 09:12:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-first-non-missing-variable/m-p/308461#M66201</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-01T09:12:44Z</dc:date>
    </item>
  </channel>
</rss>

