<?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: Multiple PROCs to Single Proc in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857247#M338721</link>
    <description>Final output and work directory are in different device. How to handle now?&lt;BR /&gt;</description>
    <pubDate>Sun, 05 Feb 2023 14:42:58 GMT</pubDate>
    <dc:creator>David_Billa</dc:creator>
    <dc:date>2023-02-05T14:42:58Z</dc:date>
    <item>
      <title>Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857225#M338707</link>
      <description>&lt;P&gt;I've many proc export step as following in single program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc export data= appdata.test1
  outfile="&amp;amp;output_location./output/&amp;amp;pprg_therapy_type.Survival_&amp;amp;reportDate._&amp;amp;reportTime..xlsx"
   dbms=xlsx
   replace;
   sheet=&amp;amp;test1;
run;


proc export data= appdata.test2  outfile="&amp;amp;output_location./output/&amp;amp;pprg_therapy_type.Survival_&amp;amp;reportDate._&amp;amp;reportTime..xlsx"
   dbms=xlsx
   replace;
   sheet=&amp;amp;test2;
run;
&lt;/PRE&gt;
&lt;P&gt;Now I want to change the output path to WORK directory and then copy that file from WORK to &amp;amp;output_location.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; %let work_path=%sysfunc(pathname(WORK));
 %put &amp;amp;=work_path;

/*Export 1*/
proc export data= appdata.test1  outfile="&amp;amp;work_path./&amp;amp;pprg_therapy_type.Survival_&amp;amp;reportDate._&amp;amp;reportTime..xlsx"
   dbms=xlsx
   replace;
   sheet=&amp;amp;test1;
run;

/*Write a code to copy file from WORK directory to &amp;amp;output_location./output/*/

/*Export 2*/
proc export data= appdata.test2  outfile="&amp;amp;work_path./&amp;amp;pprg_therapy_type.Survival_&amp;amp;reportDate._&amp;amp;reportTime..xlsx"
   dbms=xlsx
   replace;
   sheet=&amp;amp;test2;
run;

/*Write a code to copy file from WORK directory to &amp;amp;output_location./output/*/&lt;/PRE&gt;
&lt;P&gt;I want to know how efficiently we can do this instead of writing multiple proc export and proc copy. Assume the output file location is same for all files.&amp;nbsp;&lt;SPAN&gt;To clarify,&amp;nbsp;Target output location is in network drive. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm looking for efficient sample SAS program to copy files from WORK to network drive.&amp;nbsp; I don't wish to repeat the same steps over again and again. SAS environment&amp;nbsp;is SAS Studio.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 15:21:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857225#M338707</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2023-02-05T15:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857246#M338720</link>
      <description>&lt;P&gt;In case final output directory and work directory are on the same device (hard disk)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;better export directly to the output directory and save the copy step, unless you have other reasons to have them in the work directory too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In case the output directory is on a separate devices and the whole amount of data is very big you may save some overhead time by doing it in two steps, but I can't say it for sure. It depends on the hardware installation.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 14:39:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857246#M338720</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2023-02-05T14:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857247#M338721</link>
      <description>Final output and work directory are in different device. How to handle now?&lt;BR /&gt;</description>
      <pubDate>Sun, 05 Feb 2023 14:42:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857247#M338721</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2023-02-05T14:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857249#M338722</link>
      <description>&lt;P&gt;For efficiancy you got my answer in previous post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What for you need a reply ? Your code for export probably works fine.&lt;/P&gt;
&lt;P&gt;Is it &lt;STRONG&gt;how to copy&lt;/STRONG&gt; the exported excel files to the output device? As those are no sas files you better use the &lt;STRONG&gt;OS&lt;/STRONG&gt; tools for copy.&amp;nbsp;PROC COPY can't be used here. &lt;BR /&gt;In such case maybe don't use the sas work folder but define a special your own folder to export into it and copy (or move) from it to output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To help you more (either by me or someone else) please describe your sas environment and its relation to the output device.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 15:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857249#M338722</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2023-02-05T15:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857250#M338723</link>
      <description>&lt;P&gt;Below how this could look like for a Windows environment.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let work_path=%sysfunc(pathname(WORK));
%put &amp;amp;=work_path;

/*Export 1*/
proc export data=sashelp.class outfile="&amp;amp;work_path./class_1.xlsx"
   dbms=xlsx
   replace;
   sheet=test1;
run;

/*Export 2*/
proc export data=sashelp.class  outfile="&amp;amp;work_path./class_2.xlsx"
   dbms=xlsx
   replace;
   sheet=test2;
run;

data _null_;
  infile %tslit(xcopy "&amp;amp;work_path\*.xlsx" "c:\temp" /F/Y) pipe truncover end=done;
  do until(done);
    input;
    put _infile_;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As long as option XCMD is set you can do something similar in a Unix/Linux environment. I'd be using rsync in place of xcopy.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 15:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857250#M338723</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-02-05T15:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857251#M338724</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;Thank you for the insights. To clarify,&amp;nbsp;Target output location is in network drive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Two quick questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;a) Were you able to show me how this can be achieved via SAS program,&amp;nbsp; "&lt;SPAN&gt;&lt;EM&gt;As long as option XCMD is set you can do something similar in a Unix/Linux environment. I'd be using rsync in place of xcopy&lt;/EM&gt;" ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;b) Can I understand that the following infile statement will work if I change the target path from C:\ to network drive? Is %tslit&amp;nbsp; inbuild SAS macro? What is the meaning of /F/Y here?&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;infile %tslit(xcopy "&amp;amp;work_path\*.xlsx" "c:\temp" /F/Y) pipe truncover end=done;&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 Feb 2023 15:16:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857251#M338724</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2023-02-05T15:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857252#M338725</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;&lt;SPAN&gt;To clarify,&amp;nbsp;Target output location is in network drive. I'm looking for efficient sample SAS program to copy files from WORK to network drive.&amp;nbsp; I don't wish to repeat the same steps over again and again. SAS environment&amp;nbsp;is SAS Studio.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 15:20:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857252#M338725</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2023-02-05T15:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857253#M338726</link>
      <description>&lt;P&gt;Relating to your question to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;&lt;EM&gt;"will it work if I change the target path from C:\ to network drive?&amp;nbsp;" - &lt;/EM&gt;using pipe, as much as I know, you cna't use the form of &lt;STRONG&gt;X:\&lt;/STRONG&gt; for the network drive, but you have to supply the hostname and maybe user &amp;amp; password in the filename statement.&lt;/P&gt;
&lt;P&gt;I believe that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp; may give you an example. (Sorry, I dont remember the exact syntax).&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 15:32:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857253#M338726</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2023-02-05T15:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857254#M338727</link>
      <description>&lt;P&gt;Yes, %tslit() is a SAS provided macro that allows you to put single quotes around a macro variable that you first want to resolve.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"Were you able to show me how this can be achieved via SAS program"&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;The SAS code I share with you is showing it. SAS Option XCMD is required for issuing an OS command out of SAS (for example via a pipe). You could also use call system(&amp;lt;here your OS command&amp;gt;) instead of a pipe. And you will make your life much easier if you make the OS command first work out of a command prompt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;Can I understand that the following infile statement will work if I change the target path from C:\ to network drive&lt;/EM&gt;"&lt;/P&gt;
&lt;P&gt;The paths in your post indicate that you're working in a Unix/Linux environment so you can't use a Windows xcopy command but need to use a Unix/Linux command. rsync is such a command and also allows to copy files to a remote server. You need to lookup the syntax for yourself. Then use Putty and make the rsync command first work from the Putty command prompt before you "wrap" SAS around.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;...&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;if I change the target path from C:\ to network drive...&lt;/EM&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Any path will work as long as it's accessible from your SERVER where SAS executes. Or with rsync you can also connect to another server - but it still must be principally accessible from the Server where SAS executes so you need to first try from a Putty session if things can work at all.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Getting into the rsync syntax may take a bit of time - but it's a very powerful Unix command that's very worthwhile to learn.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 15:50:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857254#M338727</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-02-05T15:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857255#M338728</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp; From your statement below, I don't see XCMD option or call system statement in your code. I could see only 'pipe' option in infile statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;The SAS code I share with you is showing it. SAS Option XCMD is required for issuing an OS command out of SAS (for example via a pipe). You could also use call system(&amp;lt;here your OS command&amp;gt;) instead of a pipe. And you will make your life much easier if you make the OS command first work out of a command prompt.&lt;/PRE&gt;
&lt;P&gt;My apologies if I missed something&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 15:53:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857255#M338728</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2023-02-05T15:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857290#M338756</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp; From your statement below, I don't see XCMD option or call system statement in your code. I could see only 'pipe' option in infile statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;The SAS code I share with you is showing it. SAS Option XCMD is required for issuing an OS command out of SAS (for example via a pipe). You could also use call system(&amp;lt;here your OS command&amp;gt;) instead of a pipe. And you will make your life much easier if you make the OS command first work out of a command prompt.&lt;/PRE&gt;
&lt;P&gt;My apologies if I missed something&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;XCMD is a system option that gets set when SAS starts-up. It's how your environment is configured and nothing you as a user can change.&lt;/P&gt;
&lt;P&gt;Running Proc Options will tell you if the value is XCMD or NOXCMD&lt;/P&gt;
&lt;PRE&gt;proc options option=xcmd;
run;&lt;/PRE&gt;
&lt;P&gt;Here the SAS docu:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostunx/n02699r064oqccn19vblte8xzr8m.htm" target="_self"&gt;XCMD System Option: UNIX&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1675643593679.png" style="width: 591px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80116i718100ED6362864B/image-dimensions/591x102?v=v2" width="591" height="102" role="button" title="Patrick_0-1675643593679.png" alt="Patrick_0-1675643593679.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 00:35:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857290#M338756</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-02-06T00:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857304#M338759</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp; Got this error when I ran your code in SASViya. So I don't have access to local machine from SAS server?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ERROR: Insufficient authorization to access PIPE.&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Feb 2023 06:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857304#M338759</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2023-02-06T06:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857306#M338760</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp; Got this error when I ran your code in SASViya. So I don't have access to local machine from SAS server?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ERROR: Insufficient authorization to access PIPE.&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;On Viya xmcd is disabled by default, so you can't execute os commands.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 06:42:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857306#M338760</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2023-02-06T06:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857308#M338762</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&amp;nbsp;Thank you for the answer. What would be the alternative solution for my problem statement as told in my initial post?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 06:44:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857308#M338762</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2023-02-06T06:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857312#M338765</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;Mine is UNIX environment.&amp;nbsp; NOXCMD is set by default in our platform. How to tackle the problem in UNIX?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;NOXCMD            Disables the X command in SAS&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Feb 2023 06:52:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857312#M338765</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2023-02-06T06:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857315#M338768</link>
      <description>&lt;P&gt;With NOXCMD you're restricted to SAS. You could use FCOPY as &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.2/lefunctionsref/n10dz22b5ixohin1vwzilweetek0.htm" target="_self"&gt;documented here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BUT..... very often when people say "network drive" they are talking about their local Windows environment. Before you even try to implement SAS code for copying the file you need to ensure that the target you want to copy to is accessible from your SAS Compute Server environment. To do so use PUTTY and try to access this network drive with Unix commands only. Eventually get help from some Unix admin for this.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 08:11:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857315#M338768</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-02-06T08:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857321#M338770</link>
      <description>&lt;P&gt;Are you able to download a file from sas studio to any device ?&lt;/P&gt;
&lt;P&gt;I'm using SAS ODA which is similar to sas studio. After creating a great number of text files (.sas for backup, .html for my portal) I zip them all into one archieve file and download it to a local device. If it is appropriate for you - adapt the next code to zip all your excel files from work (or any other folder) and finaly download the zipped file to the prefered device.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/***********************************
/* zip all text files to an archieve
/* to be downloaded as one file
************************************/
%let fref = txtfile;
%let folder = &amp;lt;folder name with the files to download&amp;gt;;
filename &amp;amp;fref "~/&amp;amp;folder";

%let sufx = sas; /* download program files for backup */

%let zip_name = A_text_ziped.zip;
filename zipped "~/reports/&amp;amp;zip_name";
%let zip_ref = zipped;
&lt;BR /&gt;/** creta a list table of files to zip to archieve **/
data dir_info;
    length fname $40;
    did = dopen("&amp;amp;fref");
    members = dnum(did);  
    if did then 
       do i=1 to members;
          fname = dread(did, i);    
          if scan(fname,2,'.') = "&amp;amp;sufx" then output;
       end;  
    did = close(did);
    keep fname;
run;
&lt;BR /&gt;/** Generate a program - list of commands to execute **/
filename pgm "~/programs/ex_zipall.sas";
data _null_;
 length cmd $200;
 set dir_info end=eof;
	*** (1) delete old zip file ***;
  if _N_=1 then do;	
    if (fexist("&amp;amp;zip_ref")) then 
  	   rc = fdelete("&amp;amp;zip_ref");
  	file pgm; 
  	cmd = "filename &amp;amp;zip_ref ""~/&amp;amp;folder/&amp;amp;zip_name"";";
	put cmd;
	cmd = cats('ods package(', "&amp;amp;zip_ref", ') open nopf;');
	put cmd;
  end;

  cmd = cats('ods package(', "&amp;amp;zip_ref", ") add file=""~/&amp;amp;folder/" ,fname, """;");
  file pgm; put cmd;

  if eof then do;
    cmd = cat("ods package(",strip("&amp;amp;zip_ref"),') publish archive properties(archive_name="',
              "A_text_ziped.zip",'" archive_path="~/reports/");');
    file pgm; put cmd; 
    cmd = "ods package(&amp;amp;zip_ref) close;"; 
    put cmd; 
  end;
run;

%include pgm;
filename &amp;amp;zip_ref clear;
filename pgm clear;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you don't need the excel files after downloading, you can delete them all by adapting next code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let folder = &amp;lt;folder with files to remove*/;
filename htm "&amp;amp;folder";
data _null_;
    retain fref "reports";
    length fpath $60;
	did = dopen('htm');
	mems = dnum(did); putlog mems=;
	if did and mems then do;
	   do i=1 to mems;
	      fname = dread(did,i);
	      if scan(fname,-1,'.') = 'html' then do; 
/* 		      putlog i= fname=; */
		      fpath = cats("&amp;amp;root/",fname); putlog fpath=;
		      fc = filename(fref,fpath);
		      if fc=0 and fexist(fref) 
		      then rc = fdelete(fref);
		      msg = sysmsg();
/* 		      putlog msg=; */
		  end;   
       end;
       did = close(did);
	end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Feb 2023 08:50:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857321#M338770</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2023-02-06T08:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857323#M338772</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;&lt;SPAN&gt;FCOPY as&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.2/lefunctionsref/n10dz22b5ixohin1vwzilweetek0.htm" target="_self" rel="nofollow noopener noreferrer"&gt;documented here&lt;/A&gt;&lt;SPAN&gt;. tells for copy of one file from source to destination. In order to copy multiple files in one single go, can we use *.xlsx in Filename statement?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 09:11:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857323#M338772</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2023-02-06T09:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PROCs to Single Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857341#M338779</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;&lt;SPAN&gt;FCOPY as&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.2/lefunctionsref/n10dz22b5ixohin1vwzilweetek0.htm" target="_self" rel="nofollow noopener noreferrer"&gt;documented here&lt;/A&gt;&lt;SPAN&gt;. tells for copy of one file from source to destination. In order to copy multiple files in one single go, can we use *.xlsx in Filename statement?&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'd say you need now FIRST to test if the target file system is even reachable from your environment.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd also say it's now time that you read documentation and do a bit of your own trials.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 11:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-PROCs-to-Single-Proc/m-p/857341#M338779</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-02-06T11:20:56Z</dc:date>
    </item>
  </channel>
</rss>

