<?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: Parallel computing within a SAS proc in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Parallel-computing-within-a-SAS-proc/m-p/768382#M243724</link>
    <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/173317"&gt;@thewan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A by-statement is very efficient! It's probably not processing your samples in parallel (as there's only one SAS session in 'the game') but it's very efficient. Much more efficient than looping over your samples.&lt;BR /&gt;&lt;BR /&gt;If you are talking about parallel processing, you should mention your SAS version (SAS 9.4 Mx or SAS VIYA 3.5+).&lt;BR /&gt;Submit&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%PUT &amp;amp;=sysvlong4;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to find out.&lt;BR /&gt;&lt;BR /&gt;Anyway I think you can use MP Connect (Multi-Process Connect) if you have SAS/Connect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It works very well and I use it a lot.&lt;BR /&gt;Here's some info:&lt;/P&gt;
&lt;OL class="lia-list-style-type-lower-roman"&gt;
&lt;LI&gt;Running SAS programs in parallel using SAS/CONNECT®&lt;BR /&gt;By Leonid Batkhan on SAS Users January 13, 2021&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sgf/2021/01/13/running-sas-programs-in-parallel-using-sas-connect/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2021/01/13/running-sas-programs-in-parallel-using-sas-connect/&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Base SAS + SAS/CONNECT - A simple method to generate load on any number of licensed cores&lt;BR /&gt;Posted 04-08-2021 05:46 AM | by SimonWilliams&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Base-SAS-SAS-CONNECT-A-simple-method-to-generate-load-on-any/ta-p/732174" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Base-SAS-SAS-CONNECT-A-simple-method-to-generate-load-on-any/ta-p/732174&lt;/A&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;If you have six samples you launch 6 concurrent SAS sessions, each one dealing with one sample.&lt;BR /&gt;Like here:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options sascmd="sas";

/* Process 1 */
signon  task1;
rsubmit task1 wait=no;
 PROC LIFEREG DATA=;
 where SampleNumber="1";
 MODEL ...;
 RUN;
endrsubmit;

/* Process 2 */
signon  task2;
rsubmit task2 wait=no;
 PROC LIFEREG DATA=;
 where SampleNumber="2";
 MODEL ...;
 RUN;
endrsubmit;

/* ... ... ... */

/* Process 6 */
signon  task6;
rsubmit task6 wait=no;
 PROC LIFEREG DATA=;
 where SampleNumber="6";
 MODEL ...;
 RUN;
endrsubmit;

waitfor _all_;
signoff _all_;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Koen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Sep 2021 21:20:36 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2021-09-17T21:20:36Z</dc:date>
    <item>
      <title>Parallel computing within a SAS proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parallel-computing-within-a-SAS-proc/m-p/768351#M243716</link>
      <description>&lt;P&gt;I would like to parallelize inside a sas proc. I want to run:&lt;/P&gt;
&lt;PRE&gt;proc lifereg data=main;
 by SampleNo;
 model statement etc.
run;&lt;/PRE&gt;
&lt;P&gt;Where each sample will execute at the same time. Is that something that is possible?&amp;nbsp;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I went through this paper. &lt;A class="_3t5uN8xUmg0TOwRCOGQEcU" href="http://www.lexjansen.com/wuss/2018/15_Final_Paper_PDF.pdf" target="_blank" rel="noopener nofollow ugc"&gt;http://www.lexjansen.com/wuss/2018/15_Final_Paper_PDF.pdf&lt;/A&gt;&amp;nbsp;One of its main takeaways is that any proc or data steps that don't rely on one another can be run at the same time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 19:15:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parallel-computing-within-a-SAS-proc/m-p/768351#M243716</guid>
      <dc:creator>thewan</dc:creator>
      <dc:date>2021-09-17T19:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Parallel computing within a SAS proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parallel-computing-within-a-SAS-proc/m-p/768382#M243724</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/173317"&gt;@thewan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A by-statement is very efficient! It's probably not processing your samples in parallel (as there's only one SAS session in 'the game') but it's very efficient. Much more efficient than looping over your samples.&lt;BR /&gt;&lt;BR /&gt;If you are talking about parallel processing, you should mention your SAS version (SAS 9.4 Mx or SAS VIYA 3.5+).&lt;BR /&gt;Submit&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%PUT &amp;amp;=sysvlong4;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to find out.&lt;BR /&gt;&lt;BR /&gt;Anyway I think you can use MP Connect (Multi-Process Connect) if you have SAS/Connect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It works very well and I use it a lot.&lt;BR /&gt;Here's some info:&lt;/P&gt;
&lt;OL class="lia-list-style-type-lower-roman"&gt;
&lt;LI&gt;Running SAS programs in parallel using SAS/CONNECT®&lt;BR /&gt;By Leonid Batkhan on SAS Users January 13, 2021&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sgf/2021/01/13/running-sas-programs-in-parallel-using-sas-connect/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2021/01/13/running-sas-programs-in-parallel-using-sas-connect/&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Base SAS + SAS/CONNECT - A simple method to generate load on any number of licensed cores&lt;BR /&gt;Posted 04-08-2021 05:46 AM | by SimonWilliams&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Base-SAS-SAS-CONNECT-A-simple-method-to-generate-load-on-any/ta-p/732174" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Base-SAS-SAS-CONNECT-A-simple-method-to-generate-load-on-any/ta-p/732174&lt;/A&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;If you have six samples you launch 6 concurrent SAS sessions, each one dealing with one sample.&lt;BR /&gt;Like here:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options sascmd="sas";

/* Process 1 */
signon  task1;
rsubmit task1 wait=no;
 PROC LIFEREG DATA=;
 where SampleNumber="1";
 MODEL ...;
 RUN;
endrsubmit;

/* Process 2 */
signon  task2;
rsubmit task2 wait=no;
 PROC LIFEREG DATA=;
 where SampleNumber="2";
 MODEL ...;
 RUN;
endrsubmit;

/* ... ... ... */

/* Process 6 */
signon  task6;
rsubmit task6 wait=no;
 PROC LIFEREG DATA=;
 where SampleNumber="6";
 MODEL ...;
 RUN;
endrsubmit;

waitfor _all_;
signoff _all_;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Koen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 21:20:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parallel-computing-within-a-SAS-proc/m-p/768382#M243724</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-09-17T21:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Parallel computing within a SAS proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parallel-computing-within-a-SAS-proc/m-p/768404#M243730</link>
      <description>&lt;P&gt;The list of multithreaded procedures is available here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/rnd/scalability/procs/" target="_blank"&gt;https://support.sas.com/rnd/scalability/procs/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If you can't use one of these, you can maybe:&lt;/P&gt;
&lt;P&gt;1. Ask SAS R&amp;amp;D to add proc lifereg to the list&lt;/P&gt;
&lt;P&gt;2. Try to program the logic you need using proc DS2&lt;/P&gt;
&lt;P&gt;3. Break the table into subsets, and multithread using MPConnect as shown by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; You could also multithread using &lt;FONT face="courier new,courier"&gt;call system()&lt;/FONT&gt; but you lose any ability to synchronise the jobs&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that:&lt;/P&gt;
&lt;P&gt;- You first need to ensure that you bottleneck is the CPU. If it's the disk, you'll only make things worse by multithreading.&lt;/P&gt;
&lt;P&gt;- There are overheads when multithreading and the gains may not be as expected&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;call dosubl()&lt;/FONT&gt; is still limited to sequential processing sadly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Sep 2021 02:19:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parallel-computing-within-a-SAS-proc/m-p/768404#M243730</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-09-18T02:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Parallel computing within a SAS proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parallel-computing-within-a-SAS-proc/m-p/771534#M244852</link>
      <description>&lt;P&gt;Thank you, your example code was what I needed!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 02:17:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parallel-computing-within-a-SAS-proc/m-p/771534#M244852</guid>
      <dc:creator>thewan</dc:creator>
      <dc:date>2021-10-01T02:17:31Z</dc:date>
    </item>
  </channel>
</rss>

