<?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: Selection Across Row in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Re-Selection-Across-Row/m-p/295671#M61812</link>
    <description>&lt;P&gt;What's the data type? If it's date or character AND as in example is increasing, use the MAX() function.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Sep 2016 01:42:18 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-09-01T01:42:18Z</dc:date>
    <item>
      <title>Re: Selection Across Row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Selection-Across-Row/m-p/295667#M61811</link>
      <description>&lt;P&gt;Hi....I want to be able to select the last value across each row for each row. Is it possible to do the selection without having to transpose the dataset. Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have:&lt;/P&gt;
&lt;TABLE width="320" style="width: 240pt; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt;&lt;COL width="64" style="width: 48pt;" span="5" /&gt;&lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD width="64" height="20" style="border: 0px black; border-image: none; width: 48pt; height: 15pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Column1&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="64" style="border: 0px black; border-image: none; width: 48pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Column2&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="64" style="border: 0px black; border-image: none; width: 48pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Column3&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="64" style="border: 0px black; border-image: none; width: 48pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Column4&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="64" style="border: 0px black; border-image: none; width: 48pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Column5&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" style="border: 0px black; border-image: none; height: 15pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201011&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD align="right" style="border: 0px black; border-image: none; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201112&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD align="right" style="border: 0px black; border-image: none; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201213&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD style="border: 0px black; border-image: none; background-color: transparent;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD style="border: 0px black; border-image: none; background-color: transparent;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" style="border: 0px black; border-image: none; height: 15pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201213&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD align="right" style="border: 0px black; border-image: none; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201314&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD style="border: 0px black; border-image: none; background-color: transparent;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD style="border: 0px black; border-image: none; background-color: transparent;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD style="border: 0px black; border-image: none; background-color: transparent;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" style="border: 0px black; border-image: none; height: 15pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201516&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD style="border: 0px black; border-image: none; background-color: transparent;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD style="border: 0px black; border-image: none; background-color: transparent;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD style="border: 0px black; border-image: none; background-color: transparent;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD style="border: 0px black; border-image: none; background-color: transparent;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" style="border: 0px black; border-image: none; height: 15pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201112&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD align="right" style="border: 0px black; border-image: none; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201213&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD align="right" style="border: 0px black; border-image: none; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201314&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD align="right" style="border: 0px black; border-image: none; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201415&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD align="right" style="border: 0px black; border-image: none; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201516&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Want:&lt;/P&gt;
&lt;TABLE width="64" style="width: 48pt; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt;&lt;COL width="64" style="width: 48pt;" /&gt;&lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD width="64" height="20" style="border: 0px black; border-image: none; width: 48pt; height: 15pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Column&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" style="border: 0px black; border-image: none; height: 15pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201213&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" style="border: 0px black; border-image: none; height: 15pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201314&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" style="border: 0px black; border-image: none; height: 15pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201516&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" style="border: 0px black; border-image: none; height: 15pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;201516&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 00:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Selection-Across-Row/m-p/295667#M61811</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2016-09-01T00:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Across Row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Selection-Across-Row/m-p/295671#M61812</link>
      <description>&lt;P&gt;What's the data type? If it's date or character AND as in example is increasing, use the MAX() function.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 01:42:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Selection-Across-Row/m-p/295671#M61812</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-01T01:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Across Row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Selection-Across-Row/m-p/295675#M61815</link>
      <description>&lt;P&gt;You should be able to use arrays. &amp;nbsp;It's easier to read if you adjust the code for your variables being numeric or character (whichever they happen to be), but it can be done without necessarily knowing:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;array cols {5} column1-column5;&lt;/P&gt;
&lt;P&gt;do _n_=1 to 5;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;if not missing(cols{_n_}) then column = cols{_n_};&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 02:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Selection-Across-Row/m-p/295675#M61815</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-01T02:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Across Row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Selection-Across-Row/m-p/295699#M61827</link>
      <description>&lt;PRE&gt;

data have;
infile cards expandtabs truncover;
input Column1	Column2	Column3	Column4	Column5;
cards;
201011	201112	201213	 	 
201213	201314	 	 	 
201516	 	 	 	 
201112	201213	201314	201415	201516
;
run;
data want;
 set have;
 want=coalesce(of Column5-Column1);
run;

&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Sep 2016 07:03:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Selection-Across-Row/m-p/295699#M61827</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-09-01T07:03:27Z</dc:date>
    </item>
  </channel>
</rss>

