<?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 Using the rsubmit, endrsubmit and waitfor _all_ statements in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-the-rsubmit-endrsubmit-and-waitfor-all-statements/m-p/818191#M322962</link>
    <description>&lt;P&gt;I need to copy 7 sas files from unix to windows.&amp;nbsp; To save time, I want to submit the copy statement for each of these at the same time.&amp;nbsp; I'm using the rsubmit and endrsubmit process in a macro loop.&amp;nbsp; This way there are 7 copy statements running at the same time.&amp;nbsp; However, I can't figure out how to make the sas job wait for all the submitted copy statements to finish before continuing.&amp;nbsp; Do I use a waitfor _all_ statement, and where do I put it?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MACRO toWin;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %DO i = 1 %TO 7;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %SYSLPUT file=file.&amp;amp;i. / remote=sessw&amp;amp;i.;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;%SYSLPUT&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;mSysDir =unix directory&amp;nbsp;&lt;/SPAN&gt;/REMOTE=&lt;SPAN class=""&gt;server-ID&lt;/SPAN&gt;&amp;gt;;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%SYSLPUT&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;mStgDirW = windows directory /&lt;/SPAN&gt;REMOTE=&lt;SPAN class=""&gt;server-ID&lt;/SPAN&gt;&amp;gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;rsubmit sessw&amp;amp;i. connectwait=no connectpersist=no sysrputsync=yes;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; copy file&amp;amp;i. from unix to windows&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;endrsubmit ;&lt;/P&gt;&lt;P&gt;%end ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%toWin;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jun 2022 18:59:15 GMT</pubDate>
    <dc:creator>am2019</dc:creator>
    <dc:date>2022-06-14T18:59:15Z</dc:date>
    <item>
      <title>Using the rsubmit, endrsubmit and waitfor _all_ statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-rsubmit-endrsubmit-and-waitfor-all-statements/m-p/818191#M322962</link>
      <description>&lt;P&gt;I need to copy 7 sas files from unix to windows.&amp;nbsp; To save time, I want to submit the copy statement for each of these at the same time.&amp;nbsp; I'm using the rsubmit and endrsubmit process in a macro loop.&amp;nbsp; This way there are 7 copy statements running at the same time.&amp;nbsp; However, I can't figure out how to make the sas job wait for all the submitted copy statements to finish before continuing.&amp;nbsp; Do I use a waitfor _all_ statement, and where do I put it?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MACRO toWin;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %DO i = 1 %TO 7;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %SYSLPUT file=file.&amp;amp;i. / remote=sessw&amp;amp;i.;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;%SYSLPUT&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;mSysDir =unix directory&amp;nbsp;&lt;/SPAN&gt;/REMOTE=&lt;SPAN class=""&gt;server-ID&lt;/SPAN&gt;&amp;gt;;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%SYSLPUT&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;mStgDirW = windows directory /&lt;/SPAN&gt;REMOTE=&lt;SPAN class=""&gt;server-ID&lt;/SPAN&gt;&amp;gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;rsubmit sessw&amp;amp;i. connectwait=no connectpersist=no sysrputsync=yes;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; copy file&amp;amp;i. from unix to windows&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;endrsubmit ;&lt;/P&gt;&lt;P&gt;%end ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%toWin;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 18:59:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-rsubmit-endrsubmit-and-waitfor-all-statements/m-p/818191#M322962</guid>
      <dc:creator>am2019</dc:creator>
      <dc:date>2022-06-14T18:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using the rsubmit, endrsubmit and waitfor _all_ statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-rsubmit-endrsubmit-and-waitfor-all-statements/m-p/818193#M322964</link>
      <description>&lt;P&gt;If you just want to copy files between locations available on the same machine just use SYSTASK, no need for any RSUBMIT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But how are you planning to copy files from Windows to Unix?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you use RSIGNON to start a remote SAS session in the other environment?&amp;nbsp; In that case use PROC UPLOAD or PROC DOWNLOAD to move the files from one to the other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have the same disks shared between the two environments? In that case you are just doing local copies.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 19:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-rsubmit-endrsubmit-and-waitfor-all-statements/m-p/818193#M322964</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-14T19:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using the rsubmit, endrsubmit and waitfor _all_ statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-rsubmit-endrsubmit-and-waitfor-all-statements/m-p/818211#M322972</link>
      <description>&lt;P&gt;If you want to use parallel DOWNLOADs then you need to start a new SAS session for each one using the SIGNON statement. Then you run a separate RSUBMIT WAIT=NO group for each session followed by a WAITFOR for each session, finishing off with SIGNOFF for each session. As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;has said PROC DOWNLOAD is what you use to copy the files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also SAS and SAS/CONNECT need to be installed on both your Unix and Windows computers.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 21:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-rsubmit-endrsubmit-and-waitfor-all-statements/m-p/818211#M322972</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-06-14T21:05:10Z</dc:date>
    </item>
  </channel>
</rss>

