<?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 know, what all the xpt files in the library in sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-know-what-all-the-xpt-files-in-the-library-in-sas/m-p/914834#M360508</link>
    <description>&lt;P&gt;I think you can use the SAS directory functions to list the files, e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ExportFiles; 
   rc=filename("mydir", "&amp;lt;physical file name&amp;gt;"); 
   did=dopen("mydir"); 
   if did &amp;gt; 0 then do;
     do _N_=1 to dnum(did); 
       fname=dread(did,_N_);
       if upcase(scan(fname,-1,'.')) = 'XPT' then output;
       end;
     rc=dclose(did);
     end; 
   else do; 
     msg=sysmsg(); 
     put msg; 
     end;
   keep fname;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 07 Feb 2024 10:41:51 GMT</pubDate>
    <dc:creator>s_lassen</dc:creator>
    <dc:date>2024-02-07T10:41:51Z</dc:date>
    <item>
      <title>how to know, what all the xpt files in the library in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-know-what-all-the-xpt-files-in-the-library-in-sas/m-p/914828#M360505</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I wanted to know, what all the xpt files (only) available in the particular library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; anyone know how to find it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Abhinay&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 08:22:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-know-what-all-the-xpt-files-in-the-library-in-sas/m-p/914828#M360505</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2024-02-07T08:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to know, what all the xpt files in the library in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-know-what-all-the-xpt-files-in-the-library-in-sas/m-p/914832#M360506</link>
      <description>&lt;P&gt;Use the &lt;A title="BasePlus" href="https://github.com/SASPAC/baseplus" target="_self"&gt;BasePlus package&lt;/A&gt; and the &lt;A title="dirsAndFiles" href="https://github.com/SASPAC/baseplus/blob/main/baseplus.md#dirsandfiles-macro-6" target="_self"&gt;%dirsAndFiles() macro&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%dirsAndFiles(
C:\SAS_WORK /* directory to search (includes subdirs.) */
,ODS=work.result
,fileExt=xpt /* file extension */
)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S. Here are some instructions how to get BasePlus package and where the documentation is.&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;/*
Details about SAS Packages Framework:
- https://github.com/yabwon/SAS_PACKAGES

Tutorial:
- https://github.com/yabwon/HoW-SASPackages

BasePlus documentation:
- https://github.com/SASPAC/macroarray/blob/main/baseplus.md
*/

/* Step 1. */
/* Install SAS Packages Framework and BasePlus package. */
/* Run this only once. */
filename SPFinit url "https://bit.ly/SPFinit";
%include SPFinit; 
filename SPFinit clear;

/* create directory for the framework and packages */
filename packages "&amp;lt;/your/directory/for/packages/&amp;gt;";
/* install the framework and the BasePlus package */ 
%installPackage(SPFinit BasePlus)


/* Step 2. */
/* From now on if you want to use a package: */
/* Run this at the beginning of your new SAS Session (or add it to autoexec). */
/* Enable framework and load package  */
filename packages "&amp;lt;/your/directory/for/packages/&amp;gt;";
%include packages(SPFinit.sas); 
%loadPackage(BasePlus)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 10:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-know-what-all-the-xpt-files-in-the-library-in-sas/m-p/914832#M360506</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-07T10:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to know, what all the xpt files in the library in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-know-what-all-the-xpt-files-in-the-library-in-sas/m-p/914834#M360508</link>
      <description>&lt;P&gt;I think you can use the SAS directory functions to list the files, e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ExportFiles; 
   rc=filename("mydir", "&amp;lt;physical file name&amp;gt;"); 
   did=dopen("mydir"); 
   if did &amp;gt; 0 then do;
     do _N_=1 to dnum(did); 
       fname=dread(did,_N_);
       if upcase(scan(fname,-1,'.')) = 'XPT' then output;
       end;
     rc=dclose(did);
     end; 
   else do; 
     msg=sysmsg(); 
     put msg; 
     end;
   keep fname;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Feb 2024 10:41:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-know-what-all-the-xpt-files-in-the-library-in-sas/m-p/914834#M360508</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2024-02-07T10:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to know, what all the xpt files in the library in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-know-what-all-the-xpt-files-in-the-library-in-sas/m-p/914895#M360537</link>
      <description>&lt;P&gt;What do you mean by LIBRARY?&lt;/P&gt;
&lt;P&gt;In SAS you can use the LIBNAME statement to make a library to points to where SAS datasets and other SAS objects are stored.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But an XPT file is NOT a SAS object that would be stored in such a library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you mean a directory of files (what some call a "folder") then just use normal tools for listing the files in a directory.&amp;nbsp; This question has been asked many times.&amp;nbsp; Here is one:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/SAS-Macro-to-Check-Each-Subfolder-Within-a-Directory-and-Import/td-p/868953" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/SAS-Macro-to-Check-Each-Subfolder-Within-a-Directory-and-Import/td-p/868953&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that you will also need to take care once you have the list of XPT files as that extension has no fixed meaning.&amp;nbsp; It could be a SAS V5 Xport file produced by the XPORT libref engine.&amp;nbsp; It could be a transport file produced by PROC CPORT.&amp;nbsp; It could be a SAS V7/8/9 Xport file produced by the %LOC2XPT() system macro.&amp;nbsp; Or could be something that is not at all related to SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 17:46:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-know-what-all-the-xpt-files-in-the-library-in-sas/m-p/914895#M360537</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-02-07T17:46:14Z</dc:date>
    </item>
  </channel>
</rss>

