<?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: Loop and copy sas data files from one directory and to another with obs=0 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Loop-and-copy-sas-data-files-from-one-directory-and-to-another/m-p/175102#M44938</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;:smileyplus:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Oct 2014 19:39:44 GMT</pubDate>
    <dc:creator>EJHansen71</dc:creator>
    <dc:date>2014-10-07T19:39:44Z</dc:date>
    <item>
      <title>Loop and copy sas data files from one directory and to another with obs=0</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Loop-and-copy-sas-data-files-from-one-directory-and-to-another/m-p/175100#M44936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a SAS newbie and as such was given a simple request for which I am having a lot of trouble.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Long story short: I want to pass in an absolute directory, ant then copy all *.sas7bdat files to another directory (hardcoded in the program) with obs=0. So only the metadata. Once I have this I can use perl or bash scripting to rsync these files to another server. This is what I have that works. It is for a single file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname data '/data/prod/201004_201403_12_3_3'; /* &amp;lt;-- Search for *.sas7bdat */&lt;/P&gt;&lt;P&gt;libname metadata '/apps/ntzload/nzsas'; /*&amp;nbsp; &amp;lt;-- Copy them here with 0 obs */&lt;/P&gt;&lt;P&gt;data&amp;nbsp; metadata.allsumip; /* &amp;lt;-- Name of one of the files in the lib "data"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&amp;nbsp; data.allsumip(obs=0);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried to scour the internet and 4 SAS books to find simple looping solutions. I can get a listing of files in a directory, I can't seem to instruct sas to copy them to another directory with ZERO obs. I get error after error and instead of beating my head into a wall - I thought I'd grovel for assistance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help and patience.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 18:40:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Loop-and-copy-sas-data-files-from-one-directory-and-to-another/m-p/175100#M44936</guid>
      <dc:creator>EJHansen71</dc:creator>
      <dc:date>2014-10-07T18:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and copy sas data files from one directory and to another with obs=0</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Loop-and-copy-sas-data-files-from-one-directory-and-to-another/m-p/175101#M44937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use option obs=0 if all the datasets in a library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0433ff;"&gt;option&lt;/SPAN&gt; obs=&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;datasets&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;library&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=test;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0433ff;"&gt;copy&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;in&lt;/SPAN&gt;=test &lt;SPAN style="color: #0433ff;"&gt;out&lt;/SPAN&gt;=tests;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;option obs=max;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;For select names only:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #0433ff;"&gt;create&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;table&lt;SPAN style="color: #000000;"&gt; dsetlist &lt;/SPAN&gt;as&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;select&lt;/SPAN&gt; memname into :memlist &lt;SPAN style="color: #0433ff;"&gt;from&lt;/SPAN&gt; sashelp.vtable&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #0433ff;"&gt;where&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;libname&lt;SPAN style="color: #000000;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;'TEST'&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0433ff;"&gt;option&lt;/SPAN&gt; obs=&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;datasets&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;library&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=test;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0433ff;"&gt;copy&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;in&lt;/SPAN&gt;=test &lt;SPAN style="color: #0433ff;"&gt;out&lt;/SPAN&gt;=tests;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;select &amp;amp;memlist.;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;option obs=max;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 19:11:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Loop-and-copy-sas-data-files-from-one-directory-and-to-another/m-p/175101#M44937</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-10-07T19:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and copy sas data files from one directory and to another with obs=0</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Loop-and-copy-sas-data-files-from-one-directory-and-to-another/m-p/175102#M44938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;:smileyplus:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 19:39:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Loop-and-copy-sas-data-files-from-one-directory-and-to-another/m-p/175102#M44938</guid>
      <dc:creator>EJHansen71</dc:creator>
      <dc:date>2014-10-07T19:39:44Z</dc:date>
    </item>
  </channel>
</rss>

