<?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: How to download a folder from SAS On Demand to local pc? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-download-a-folder-from-SAS-On-Demand-to-local-pc/m-p/806954#M81741</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/329008"&gt;@marta25&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Using the ODS PACKAGE to create a zip file (&lt;A title="Creating ZIP Files with ODS" href="https://support.sas.com/resources/papers/proceedings13/131-2013.pdf" target="_self"&gt;Creating ZIP Files with ODS&lt;/A&gt;) of all your files, and save it in your Home directory ('/home/u48749812/')&lt;/LI&gt;
&lt;LI&gt;Select the generated zip file then use SAS Studio's Download tool&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Studio_tools.PNG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70280iF70D3F3291324B30/image-size/small?v=v2&amp;amp;px=200" role="button" title="Studio_tools.PNG" alt="Studio_tools.PNG" /&gt;&lt;/span&gt;to download it to you local PC&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
    <pubDate>Sat, 09 Apr 2022 22:20:05 GMT</pubDate>
    <dc:creator>AhmedAl_Attar</dc:creator>
    <dc:date>2022-04-09T22:20:05Z</dc:date>
    <item>
      <title>How to download a folder from SAS On Demand to local pc?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-download-a-folder-from-SAS-On-Demand-to-local-pc/m-p/806913#M81739</link>
      <description>&lt;P&gt;I know this has been answered before but I could not find the solution that works for me. The task seems to be easier, I just want to download a folder (named "my_data") containing all my data from SAS on demand to my pc locally. Does someone know an easy solution to this? I am trying this code but does not work (it keeps running forever):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename indir '/home/u48749812/my_data';
filename out zip '/home/u48749812/my_data.zip';
data _null_;
  length fname mname $256 ;
  did=dopen('indir');
  putlog did=;
  do i=1 to dnum(did) ;
     mname=dread(did,i);
     if scan(mname,-1,'.')='sas7bdat' then do;
       n+1;
       putlog n= mname= ;
       fname=catx('/',pathname('indir'),mname);
       infile dummy filevar=fname end=eof;
       file out memvar=mname;
       do while (not eof);
         input ;
         put _infile_;
       end;
     end;
  end;
  did=dclose(did);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2022 09:45:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-download-a-folder-from-SAS-On-Demand-to-local-pc/m-p/806913#M81739</guid>
      <dc:creator>marta25</dc:creator>
      <dc:date>2022-04-09T09:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to download a folder from SAS On Demand to local pc?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-download-a-folder-from-SAS-On-Demand-to-local-pc/m-p/806950#M81740</link>
      <description>&lt;P&gt;INFILE and SAS data sets are typically not used. INFILE and INPUT are expecting text files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest a test getting rid of all the attempt to read from a directory and hard code the name of one data set and see if you can write it out the way you have attempted and see what happens. (Or did you try that earlier?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest looking into Proc Cport to create a transport file from all the datasets in a library. One advantage of transport files that when read into another system using Proc Cimport the OS version doesn't matter as it does a conversion to a native to the new host SAS version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2022 21:50:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-download-a-folder-from-SAS-On-Demand-to-local-pc/m-p/806950#M81740</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-04-09T21:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to download a folder from SAS On Demand to local pc?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-download-a-folder-from-SAS-On-Demand-to-local-pc/m-p/806954#M81741</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/329008"&gt;@marta25&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Using the ODS PACKAGE to create a zip file (&lt;A title="Creating ZIP Files with ODS" href="https://support.sas.com/resources/papers/proceedings13/131-2013.pdf" target="_self"&gt;Creating ZIP Files with ODS&lt;/A&gt;) of all your files, and save it in your Home directory ('/home/u48749812/')&lt;/LI&gt;
&lt;LI&gt;Select the generated zip file then use SAS Studio's Download tool&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Studio_tools.PNG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70280iF70D3F3291324B30/image-size/small?v=v2&amp;amp;px=200" role="button" title="Studio_tools.PNG" alt="Studio_tools.PNG" /&gt;&lt;/span&gt;to download it to you local PC&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2022 22:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-download-a-folder-from-SAS-On-Demand-to-local-pc/m-p/806954#M81741</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2022-04-09T22:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to download a folder from SAS On Demand to local pc?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-download-a-folder-from-SAS-On-Demand-to-local-pc/m-p/806957#M81742</link>
      <description>&lt;P&gt;Do you have SAS datasets in subdirectories?&lt;/P&gt;
&lt;P&gt;If not then just use PROC CPORT to make one file with all of the datasets.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mydata '/home/u48749812/my_data/';
filename out zip '/home/u48749812/my_data.zip' memname='my_data.cport';
proc cport lib=mydata file=out mt=data;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If yes then you will need to process each directory with SAS datasets separately.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mydata '/home/u48749812/my_data/';
filename out zip '/home/u48749812/my_data.zip' memname='my_data.cport';
proc cport lib=mydata file=out mt=data;
run;

libname mydata '/home/u48749812/other_data/';
filename out zip '/home/u48749812/my_data.zip' memname='other_data.cport';
proc cport lib=mydata file=out mt=data;
run;

...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note your program is reading SAS datasets as if they are text files.&amp;nbsp; Even if it was successful in writing to the ZIP file the files written would be useless.&amp;nbsp; You should read/write them as BINARY data instead.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2022 22:41:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-download-a-folder-from-SAS-On-Demand-to-local-pc/m-p/806957#M81742</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-04-09T22:41:07Z</dc:date>
    </item>
  </channel>
</rss>

