<?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 Running multiple queries parallely in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-queries-parallely/m-p/23676#M3936</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I have 5 queries in 5 different sas files that takes 5 hrs app. while running sequentially using %include in main sas code. I'm planning to run all of them in parallel so that they will complete in 3 hrs.&lt;BR /&gt;
&lt;BR /&gt;
I tried using PIPE and X command by calling the shell scripts which are calling these five jobs in each, but is there any way to run them in parallel in main code itself?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Guru</description>
    <pubDate>Tue, 18 May 2010 06:11:33 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-05-18T06:11:33Z</dc:date>
    <item>
      <title>Running multiple queries parallely</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-queries-parallely/m-p/23676#M3936</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I have 5 queries in 5 different sas files that takes 5 hrs app. while running sequentially using %include in main sas code. I'm planning to run all of them in parallel so that they will complete in 3 hrs.&lt;BR /&gt;
&lt;BR /&gt;
I tried using PIPE and X command by calling the shell scripts which are calling these five jobs in each, but is there any way to run them in parallel in main code itself?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Guru</description>
      <pubDate>Tue, 18 May 2010 06:11:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-queries-parallely/m-p/23676#M3936</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-18T06:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Running multiple queries parallely</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-queries-parallely/m-p/23677#M3937</link>
      <description>My personal preference would be to use systask() in the main program as it gives you a lot of control on how the child processes are executed (parallel or sequential).</description>
      <pubDate>Tue, 18 May 2010 09:07:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-queries-parallely/m-p/23677#M3937</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-05-18T09:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Running multiple queries parallely</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-queries-parallely/m-p/23678#M3938</link>
      <description>I have successfully used SAS/CONNECT for this purpose. If you have this licensed then this could be an option. The trick is to use the WAIT = NO option when submitting the child jobs as this then allows the controlling SAS job to continue without waiting for the submitted child SAS job/session to finish. &lt;BR /&gt;
&lt;BR /&gt;
For example running two parallel jobs from a controlling SAS session:&lt;BR /&gt;
&lt;BR /&gt;
signon session1;&lt;BR /&gt;
signon session2;&lt;BR /&gt;
&lt;BR /&gt;
rsubmit session1 wait = no;&lt;BR /&gt;
  %include "program1.sas";&lt;BR /&gt;
endrsubmit;&lt;BR /&gt;
&lt;BR /&gt;
rsubmit session2 wait = no;&lt;BR /&gt;
  %include "program2.sas";&lt;BR /&gt;
endrsubmit;&lt;BR /&gt;
&lt;BR /&gt;
Please note that session1 and session2 could be defined as additional SAS sessions on the same computer you are working on or they could refer to a remote computer. The choice is yours. &lt;BR /&gt;
&lt;BR /&gt;
There is the problem of not knowing when the child sessions finish their work so you can continue on afterwards with more processing. This can be solved by getting the child sessions to write a special file or dataset when they end. Your controlling SAS session can periodically check for these special files and only continue after they are created.</description>
      <pubDate>Thu, 20 May 2010 01:39:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-queries-parallely/m-p/23678#M3938</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2010-05-20T01:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Running multiple queries parallely</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-queries-parallely/m-p/23679#M3939</link>
      <description>to support asynchronos remote processing (like sas mpConnect) SAS/Connect provides features like WAITFOR&lt;BR /&gt;
Lifted from the on-line help and documentation [pre]/* Wait for both tasks to complete. */&lt;BR /&gt;
waitfor _all_ task1 task2;[/pre] which comes in SAS/Connect Using Compute Services Example 5: Using MP CONNECT and the WAITFOR Statement&lt;BR /&gt;
That collection of examples can be found at &lt;A href="http://support.sas.com/documentation/cdl/en/connref/61908/HTML/default/a000585202.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/connref/61908/HTML/default/a000585202.htm&lt;/A&gt; .&lt;BR /&gt;
 &lt;BR /&gt;
enjoy the potential&lt;BR /&gt;
 &lt;BR /&gt;
peterC</description>
      <pubDate>Fri, 21 May 2010 11:43:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-queries-parallely/m-p/23679#M3939</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-05-21T11:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Running multiple queries parallely</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-multiple-queries-parallely/m-p/23680#M3940</link>
      <description>Thanks for the tip Peter.&lt;BR /&gt;
&lt;BR /&gt;
WAITFOR is definitely the way to go to take back control after child parallel SAS processes have run.</description>
      <pubDate>Mon, 24 May 2010 02:36:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-multiple-queries-parallely/m-p/23680#M3940</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2010-05-24T02:36:02Z</dc:date>
    </item>
  </channel>
</rss>

