<?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: Diagonal as horizontal in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120920#M259721</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know that "below this one" means, perhaps my math education is lacking.&amp;nbsp; I only know of using 'diagonal' to mean the primary diagonal, either top left to bottom right or top right to bottom left.&amp;nbsp; If you want something else, please explain.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Oct 2013 14:01:08 GMT</pubDate>
    <dc:creator>snoopy369</dc:creator>
    <dc:date>2013-10-24T14:01:08Z</dc:date>
    <item>
      <title>Diagonal as horizontal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120910#M259711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I want to list the diagonal horizontal. Any suggestions? I dont have IML.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2013 11:41:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120910#M259711</guid>
      <dc:creator>thod</dc:creator>
      <dc:date>2013-10-23T11:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Diagonal as horizontal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120911#M259712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean data that looks like this:&lt;/P&gt;&lt;P&gt;1 . . . .&lt;/P&gt;&lt;P&gt;. 2 . . .&lt;/P&gt;&lt;P&gt;. . 3. . .&lt;/P&gt;&lt;P&gt;. . . 4 .&lt;/P&gt;&lt;P&gt;. . . .&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To look&amp;nbsp; like this:&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2013 11:43:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120911#M259712</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-10-23T11:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Diagonal as horizontal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120912#M259713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Yes, or like this:&lt;/P&gt;&lt;P&gt;1 2 3 4 5&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2013 12:02:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120912#M259713</guid>
      <dc:creator>thod</dc:creator>
      <dc:date>2013-10-23T12:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Diagonal as horizontal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120913#M259714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So you coukd do this:&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input var1 var2 var3 var4 var5;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 . . . .&lt;/P&gt;&lt;P&gt;. 2 . . .&lt;/P&gt;&lt;P&gt;. . 3. . .&lt;/P&gt;&lt;P&gt;. . . 4 .&lt;/P&gt;&lt;P&gt;. . . .&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_want = max(of var1--var5);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc transpose data = want out = want_tran;var var_want;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is assuming that you have missing on the non-diagonal values.&lt;/P&gt;&lt;P&gt;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2013 12:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120913#M259714</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-10-23T12:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Diagonal as horizontal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120914#M259715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anca,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tx, with a little adjustments it Works to my needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Made my day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2013 12:23:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120914#M259715</guid>
      <dc:creator>thod</dc:creator>
      <dc:date>2013-10-23T12:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Diagonal as horizontal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120915#M259716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any solution if the non-diagonal values not are missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2013 13:04:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120915#M259716</guid>
      <dc:creator>thod</dc:creator>
      <dc:date>2013-10-23T13:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Diagonal as horizontal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120916#M259717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So IML would probably be desired for this.&lt;/P&gt;&lt;P&gt;Otherwise, you will need some sort of array to pass through and somehow tell SAS you want the column+1....&lt;/P&gt;&lt;P&gt;Yeah, I don't know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2013 13:43:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120916#M259717</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-10-23T13:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Diagonal as horizontal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120917#M259718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could just use an array.&amp;nbsp; e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input var1 var2 var3 var4 var5;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 . . . .&lt;/P&gt;&lt;P&gt;. 2 . . .&lt;/P&gt;&lt;P&gt;. . 3. . .&lt;/P&gt;&lt;P&gt;. . . 4 .&lt;/P&gt;&lt;P&gt;. . . .&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want (keep=var_want);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array all _all_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var_want = all(_n_);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2013 14:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120917#M259718</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-10-23T14:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Diagonal as horizontal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120918#M259719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Similarly to Art's solution, but horizontal - using a temporary (and automatically retained) array to store the values and then copy back to the PDV in the last row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input var1 var2 var3 var4 var5;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 . . . .&lt;/P&gt;&lt;P&gt;. 2 . . .&lt;/P&gt;&lt;P&gt;. . 3. . .&lt;/P&gt;&lt;P&gt;. . . 4 .&lt;/P&gt;&lt;P&gt;. . . .&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have end=eof;&lt;/P&gt;&lt;P&gt;array all _all_;&lt;/P&gt;&lt;P&gt;array temps [9999] _temporary_;&lt;/P&gt;&lt;P&gt;temps[_n_]=all[_n_];&lt;/P&gt;&lt;P&gt;if eof then do;&lt;/P&gt;&lt;P&gt; do _t = 1 to dim(all);&lt;/P&gt;&lt;P&gt;&amp;nbsp; all[_t]=temps[_t];&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2013 14:11:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120918#M259719</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2013-10-23T14:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Diagonal as horizontal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120919#M259720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Snoopy369,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx for the answer. Do you also have a solution if I want tje diagonals below this one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 08:40:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120919#M259720</guid>
      <dc:creator>thod</dc:creator>
      <dc:date>2013-10-24T08:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Diagonal as horizontal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120920#M259721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know that "below this one" means, perhaps my math education is lacking.&amp;nbsp; I only know of using 'diagonal' to mean the primary diagonal, either top left to bottom right or top right to bottom left.&amp;nbsp; If you want something else, please explain.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 14:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120920#M259721</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2013-10-24T14:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Diagonal as horizontal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120921#M259722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, here is a possible one for horizontal, credit to Data_null_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input var1 var2 var3 var4 var5;&lt;/P&gt;&lt;P&gt;retain id 1;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 . . . .&lt;/P&gt;&lt;P&gt;. 2 . . .&lt;/P&gt;&lt;P&gt;. . 3. . .&lt;/P&gt;&lt;P&gt;. . . 4 .&lt;/P&gt;&lt;P&gt;. . . . 5&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt; update have(obs=0) have;&lt;/P&gt;&lt;P&gt; by id;&lt;/P&gt;&lt;P&gt; drop id;&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 14:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Diagonal-as-horizontal/m-p/120921#M259722</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-10-24T14:30:36Z</dc:date>
    </item>
  </channel>
</rss>

