<?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: Sorting a Muldimensional Array/Matrix inside a FCMP function in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Sorting-a-Muldimensional-Array-Matrix-inside-a-FCMP-function/m-p/530653#M5783</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60262"&gt;@Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a muldimensional array &lt;SPAN&gt;array_mult_zero_coupon&lt;/SPAN&gt;[500,4] and I would like to sort it by a specific dimension/Column (example: by the second dimension).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Two Questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;1. Can I use Call Sortn() function in the Proc FCMP ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;call sortn(of array_mult_zero_coupon[*]);&lt;BR /&gt;ERROR: Argument number 1 to the CALL subroutine SORTN must be a variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;2. Does anyone could give a example of how to sort an multidimensional/matrix array without call sort?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When discussing errors it is always a good idea to include the entire proc or data step that generated the error from the log as well as all notes, warnings and errors. Best is to paste the text copied from the log into a code box opened with the forum's {I} icon to preserve formatting of messages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suspect from the incomplete code that you have an issue with declaring the parameters for the function or subroutine that attempts to use call sortn.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jan 2019 15:46:42 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-01-28T15:46:42Z</dc:date>
    <item>
      <title>Sorting a Muldimensional Array/Matrix inside a FCMP function</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Sorting-a-Muldimensional-Array-Matrix-inside-a-FCMP-function/m-p/530531#M5759</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a muldimensional array &lt;SPAN&gt;array_mult_zero_coupon&lt;/SPAN&gt;[500,4] and I would like to sort it by a specific dimension/Column (example: by the second dimension).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Two Questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;1. Can I use Call Sortn() function in the Proc FCMP ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;call sortn(of array_mult_zero_coupon[*]);&lt;BR /&gt;ERROR: Argument number 1 to the CALL subroutine SORTN must be a variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;2. Does anyone could give a example of how to sort an multidimensional/matrix array without call sort?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 02:13:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Sorting-a-Muldimensional-Array-Matrix-inside-a-FCMP-function/m-p/530531#M5759</guid>
      <dc:creator>Billa</dc:creator>
      <dc:date>2019-01-28T02:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting a Muldimensional Array/Matrix inside a FCMP function</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Sorting-a-Muldimensional-Array-Matrix-inside-a-FCMP-function/m-p/530653#M5783</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60262"&gt;@Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a muldimensional array &lt;SPAN&gt;array_mult_zero_coupon&lt;/SPAN&gt;[500,4] and I would like to sort it by a specific dimension/Column (example: by the second dimension).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Two Questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;1. Can I use Call Sortn() function in the Proc FCMP ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;call sortn(of array_mult_zero_coupon[*]);&lt;BR /&gt;ERROR: Argument number 1 to the CALL subroutine SORTN must be a variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;2. Does anyone could give a example of how to sort an multidimensional/matrix array without call sort?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When discussing errors it is always a good idea to include the entire proc or data step that generated the error from the log as well as all notes, warnings and errors. Best is to paste the text copied from the log into a code box opened with the forum's {I} icon to preserve formatting of messages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suspect from the incomplete code that you have an issue with declaring the parameters for the function or subroutine that attempts to use call sortn.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 15:46:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Sorting-a-Muldimensional-Array-Matrix-inside-a-FCMP-function/m-p/530653#M5783</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-01-28T15:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting a Muldimensional Array/Matrix inside a FCMP function</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Sorting-a-Muldimensional-Array-Matrix-inside-a-FCMP-function/m-p/531608#M5918</link>
      <description>&lt;P&gt;Billa:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your Two Questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;1. Can I use Call Sortn() function in the Proc FCMP ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;call sortn(of array_mult_zero_coupon[*]);&lt;BR /&gt;ERROR: Argument number 1 to the CALL subroutine SORTN must be a variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;2. Does anyone could give a example of how to sort an multidimensional/matrix array without call sort?&lt;/P&gt;
&lt;P&gt;===========================&lt;/P&gt;
&lt;P&gt;[1] Call SORTN() does not work in FCMP Environment. I confirm that I got the same ERROR as you have got. The OF operator within Call SORTN() is not working. So, sorting array within FCMP function has to depend on&amp;nbsp; an external sorting routine. Paul Dorfman gave a Quicksort Macro which can be adapted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[2] I can provide an example. Do you want sorting on ALL Rows or Columns of the Data Set ? Or on a given Row / Column ? If you specify your requirements, I can give you a FCMP function example using a FCMP Sorting Routine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DataSP&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 11:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Sorting-a-Muldimensional-Array-Matrix-inside-a-FCMP-function/m-p/531608#M5918</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2019-01-31T11:29:28Z</dc:date>
    </item>
  </channel>
</rss>

