<?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 how to fetch SAS dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164952#M31866</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to fetch the SAS dataset from XYZ location out of the SAS Server which is having N number of folders and Those folders contains N numbers of sub-folders.Sub-folders contains different extension Files including SAS,therefore I need to fetch Only SAS file from every folders as well sub-folder and need copy to some ABC Location out of the SAS server in One Folder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your help will appreciate. Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 May 2014 14:59:18 GMT</pubDate>
    <dc:creator>dishant</dc:creator>
    <dc:date>2014-05-19T14:59:18Z</dc:date>
    <item>
      <title>how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164952#M31866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to fetch the SAS dataset from XYZ location out of the SAS Server which is having N number of folders and Those folders contains N numbers of sub-folders.Sub-folders contains different extension Files including SAS,therefore I need to fetch Only SAS file from every folders as well sub-folder and need copy to some ABC Location out of the SAS server in One Folder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your help will appreciate. Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 14:59:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164952#M31866</guid>
      <dc:creator>dishant</dc:creator>
      <dc:date>2014-05-19T14:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164953#M31867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are speaking of physical folders, and Base SAS data sets, you need some UNIX/Windows scripting expert to help you fins all locations.&lt;/P&gt;&lt;P&gt;If you are lucky, there exist autoexec.sas-files or similar with libref statements which lets you fins your data locations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 15:15:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164953#M31867</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-05-19T15:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164954#M31868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a search on here for directory listings, e.g.&lt;/P&gt;&lt;P&gt;filename mypipe 'dir "..."';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile mypipe...;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically you send a DOS directory command output back into a dataset where you can pull out directories/files etc. and then use that further in your processing. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 15:22:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164954#M31868</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-19T15:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164955#M31869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per your suggestion its completely new concept for me. Could you please elaborate it with example, how to fetch SAS Codes from one location within sub-folders and copy to another location all codes in one folder so it would be easy for me to understand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 04:54:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164955#M31869</guid>
      <dc:creator>dishant</dc:creator>
      <dc:date>2014-05-20T04:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164956#M31870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi RW9,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying to catch your logic Initially got the success but while copying part I got failed. Below was my try.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%global&amp;nbsp; pt ;&lt;/P&gt;&lt;P&gt;%let pt = 'dir "XYZ" /s';&lt;/P&gt;&lt;P&gt;%put &amp;amp;pt.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename DIRLIST1 pipe &amp;amp;pt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data dirlist ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length buffer $256 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile dirlist1 length=reclen ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input buffer $varying256. reclen ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data path_file;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set dirlist;&lt;/P&gt;&lt;P&gt;&amp;nbsp; where index(strip(upcase(buffer)),'.SAS') &amp;gt; 0 ;*and scan(strip(upcase(buffer)),1,"") ^= "DIRECTORY" ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; num = 1;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname dishant "ABC" ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc datasets memtype=(data program);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; copy out=dishant;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select path_file ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per Code In my &lt;STRONG&gt;path_file&lt;/STRONG&gt; Dataset I have all SAS File Now want to copy those all files into ABC location Instead of &lt;STRONG&gt;path_file&lt;/STRONG&gt; Dataset Contains file. Please Help Me on copying the files. Thanks In advance.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 07:13:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164956#M31870</guid>
      <dc:creator>dishant</dc:creator>
      <dc:date>2014-05-20T07:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164957#M31871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the buffer variable, you have the whole path name of the files you searched for. You now have to extract the directory path (everything up to the last \), which you later use to assign a libname to, so you can use that libname as the source lib in the proc datasets procedure. You also extract the filename itself, strip the .sas7bdat and get the logical SAS member name of the dataset. This is what you use in the select statement of proc datasets.&lt;/P&gt;&lt;P&gt;What it amounts to is a lot of call execute or macro processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you do it with the help of the operating system.&lt;/P&gt;&lt;P&gt;In UNIX it would look like that:&lt;/P&gt;&lt;P&gt;find $PATH -type f -name \*.sas7bdat -exec cp {} $TARGET \;&lt;/P&gt;&lt;P&gt;I'd assume that windows has a usable equivalent of the find command by now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 07:39:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164957#M31871</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-05-20T07:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164958#M31872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A word of caution: memtype=program does not cover your ordinary .sas files, which are basically plain text, but precompiled SAS programs!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 07:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164958#M31872</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-05-20T07:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164959#M31873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, assuming you have buffer that looks something like:&lt;/P&gt;&lt;P&gt;Buffer&lt;/P&gt;&lt;P&gt;s:\temp\somedirectory\Aprog.sas&lt;/P&gt;&lt;P&gt;s:\temp\somedirectory\Bprog.sas&lt;/P&gt;&lt;P&gt;s:\temp\somedirectory\subdir\data\abc.sas7bdat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you could just generate the code from there - assumes the directories to copy to exist!:&lt;/P&gt;&lt;P&gt;data dirlist;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrib commandstr format=$2000.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if index(buffer,"data")&amp;gt;0 then commandstr='copy "'||strip(buffer)||'" "s:\abc\data"';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else commandstr='copy "'||strip(buffer)||'" "s:\abc\"';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('x commandstr');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Note - untested, but should be similar */&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 08:10:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164959#M31873</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-20T08:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164960#M31874</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;In my Buffer my data will look like below,&lt;/P&gt;&lt;P&gt;Buffer&lt;/P&gt;&lt;P&gt;08/05/2012&amp;nbsp; 06:35&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 214,016&lt;STRONG&gt; tblsystem.sas7bdat&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;06/05/2014&amp;nbsp; 08:03&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4,987&lt;STRONG&gt; DER_CAFQ056A2212_188669.sas&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;06/05/2014&amp;nbsp; 06:35&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13,312 &lt;STRONG&gt;tblcountryregions.sas7bdat&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above Bold characters is my SAS Code in XYZ location those Code Names Showing in Buffer&lt;STRONG style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; path_file&lt;/STRONG&gt; dataset , want to copy all code which is in Buffer Variable to ABC location With Contains Of that code respective.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please revert back me on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 08:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164960#M31874</guid>
      <dc:creator>dishant</dc:creator>
      <dc:date>2014-05-20T08:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164961#M31875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So this code:&lt;/P&gt;&lt;P&gt;filename tmp pipe 'dir "s:\temp\rob" /s';&lt;/P&gt;&lt;P&gt;data a;&lt;BR /&gt;&amp;nbsp; length buffer $2000;&lt;BR /&gt;&amp;nbsp; infile tmp;&lt;BR /&gt;&amp;nbsp; input buffer $2000.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will yield something like:&lt;/P&gt;&lt;P&gt;buffer&lt;/P&gt;&lt;P&gt;Volume Serial Number is xxxxx&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Drop this */&lt;/P&gt;&lt;P&gt;Directory of s:\temp\temp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Drop the Directory of, using tranwrd, and retain this as path-to */&lt;/P&gt;&lt;P&gt;15/02/2014&amp;nbsp; 16:34&amp;nbsp; &amp;lt;DIR&amp;gt; ...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Drop this */&lt;/P&gt;&lt;P&gt;13/02/2014&amp;nbsp;&amp;nbsp; 12:34&amp;nbsp; adataset.sas7bdat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* substr(scan(xx,2," ")+1) = filename.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will then have:&lt;/P&gt;&lt;P&gt;pathto&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file&lt;/P&gt;&lt;P&gt;s:\temp\temp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; adataset.sas7bdat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And its just a matter of copy "pathto\file" "s:abc"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 08:45:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164961#M31875</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-20T08:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164962#M31876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RW9,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;matter of copy "pathto\file" "s:abc"only giving the problem,Can you please give example for Better.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;My Final data Is Like Below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Filename&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileLoc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;tblcountryregions.sas7bdat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\s:\abc\ISCR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;tblsystem.sas7bdat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\s:\abc\ISCR\181395\A&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;HAA00616_DER.sas&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;\\s:\abc\ISCR\181396&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per My criteria I want All File In &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;"\\T:\xyz" Location.How?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 09:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164962#M31876</guid>
      <dc:creator>dishant</dc:creator>
      <dc:date>2014-05-20T09:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164963#M31877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RW9,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Above message I Need all File&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; In &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;"\\T:\xyz" Location Which look Like Below,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;tblcountryregions.sas7bdat&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;tblsystem.sas7bdat&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;tblsystem.sas7bdat&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;On Clicking of respective file it should contains Respective material for respective files. How?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 09:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164963#M31877</guid>
      <dc:creator>dishant</dc:creator>
      <dc:date>2014-05-20T09:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164964#M31878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RW9,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its Containing N Number Of Files At N number of folders and sub-folders,want to fetch those Only SAS File and need to Copy &lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;"\\T:\xyz" location,Therefore In my Filename Have Only SAS File With Respective FileLoc and finally need to copy all those file to &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;above&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; location.How?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please revert me back on this to achieve final step of destination.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 09:48:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164964#M31878</guid>
      <dc:creator>dishant</dc:creator>
      <dc:date>2014-05-20T09:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164965#M31879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, I have two files in: s:\temp\rob\xyz, ABC.txt and ABC2.txt (it doesn't matter what the file extension is, they could just as easily be .sas or .sas7bdat the process is the same).&amp;nbsp; Then I have a subdirectory s:\temp\rob\xyz\dgh with two files ERT.txt, ERT2.txt.&amp;nbsp; I then submit this program in SAS:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename tmp pipe 'dir "S:\Temp\Rob\XYZ" /s /b';&lt;/P&gt;&lt;P&gt;data dir;&lt;BR /&gt;&amp;nbsp; length buffer $2000.;&lt;BR /&gt;&amp;nbsp; infile tmp;&lt;BR /&gt;&amp;nbsp; input buffer $2000.;&lt;BR /&gt;&amp;nbsp; command="x 'copy "||'"'||strip(buffer)||'" "s:\temp\rob"'||"';";&lt;BR /&gt;&amp;nbsp; call execute(command);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This reads in the directory listing for XYZ with all subdirectories, bare format so only path\file.&amp;nbsp; I then call execute a system command to copy each one to a new folder s:\temp\rob.&amp;nbsp; The x 'copy "..." "..."'; is a dos command to copy a file (of any type) to a new location.&amp;nbsp; I feed it with the directory listing.&amp;nbsp; You can modify the above to only process SAS programs or datasets with a simple if then else.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 10:29:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164965#M31879</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-20T10:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164966#M31880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;filename my pipe 'dir c:\temp\*.sas7bdat /s /b' ;
 
data _null_;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile my length=len;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file 'c:\temp\copy.bat';
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input file $varying200. len;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'copy ' file 'd:\';
run;
x 'c:\temp\copy.bat';
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 12:06:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164966#M31880</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-05-20T12:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164967#M31881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RW9,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for more update but last to want fetch only &lt;STRONG&gt;.sas&lt;/STRONG&gt; File not .sas7bdat, since as per your code its fetching both files.How to avoid that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 04:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164967#M31881</guid>
      <dc:creator>dishant</dc:creator>
      <dc:date>2014-05-21T04:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to fetch SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164968#M31882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the length() function, count the last 4 characters from there and compare with '.sas'. Basic SAS coding.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 05:36:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-fetch-SAS-dataset/m-p/164968#M31882</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-05-21T05:36:15Z</dc:date>
    </item>
  </channel>
</rss>

