<?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 determine proper file name with Proc Export? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-determine-proper-file-name-with-Proc-Export/m-p/604295#M76504</link>
    <description>&lt;P&gt;I am trying to use proc export to export a SAS file to excel. The issue is that the file is not something that I created; it existed already in a library accessible via SAS, so I don't know what to call the file I need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I am doing:&lt;/P&gt;&lt;P&gt;proc export&lt;/P&gt;&lt;P&gt;data= FILE NAME THAT I DON'T KNOW&lt;/P&gt;&lt;P&gt;DBMS = XLSX&lt;/P&gt;&lt;P&gt;Outfile = "place I want the file to go"&lt;/P&gt;&lt;P&gt;replace;&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;&lt;BR /&gt;I can see and look at the file I need via the library it is in, but I don't know how to write the file name - if that makes sense? I have copy and pasted the actual file name without any extra library information, and that did not work, and now I am at a loss. This file is pretty deep into a bunch of folders, so the path would be something like "sasApp/folder1/201601/estimate/revision/data/FILE I NEED".&lt;/P&gt;</description>
    <pubDate>Thu, 14 Nov 2019 21:16:20 GMT</pubDate>
    <dc:creator>IvyMcKee</dc:creator>
    <dc:date>2019-11-14T21:16:20Z</dc:date>
    <item>
      <title>How to determine proper file name with Proc Export?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-determine-proper-file-name-with-Proc-Export/m-p/604295#M76504</link>
      <description>&lt;P&gt;I am trying to use proc export to export a SAS file to excel. The issue is that the file is not something that I created; it existed already in a library accessible via SAS, so I don't know what to call the file I need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I am doing:&lt;/P&gt;&lt;P&gt;proc export&lt;/P&gt;&lt;P&gt;data= FILE NAME THAT I DON'T KNOW&lt;/P&gt;&lt;P&gt;DBMS = XLSX&lt;/P&gt;&lt;P&gt;Outfile = "place I want the file to go"&lt;/P&gt;&lt;P&gt;replace;&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;&lt;BR /&gt;I can see and look at the file I need via the library it is in, but I don't know how to write the file name - if that makes sense? I have copy and pasted the actual file name without any extra library information, and that did not work, and now I am at a loss. This file is pretty deep into a bunch of folders, so the path would be something like "sasApp/folder1/201601/estimate/revision/data/FILE I NEED".&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 21:16:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-determine-proper-file-name-with-Proc-Export/m-p/604295#M76504</guid>
      <dc:creator>IvyMcKee</dc:creator>
      <dc:date>2019-11-14T21:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine proper file name with Proc Export?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-determine-proper-file-name-with-Proc-Export/m-p/604309#M76505</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/298390"&gt;@IvyMcKee&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to use proc export to export a SAS file to excel. The issue is that the file is not something that I created; it existed already in a library accessible via SAS, so I don't know what to call the file I need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what I am doing:&lt;/P&gt;
&lt;P&gt;proc export&lt;/P&gt;
&lt;P&gt;data= FILE NAME THAT I DON'T KNOW&lt;/P&gt;
&lt;P&gt;DBMS = XLSX&lt;/P&gt;
&lt;P&gt;Outfile = "place I want the file to go"&lt;/P&gt;
&lt;P&gt;replace;&lt;/P&gt;
&lt;P&gt;run;&lt;BR /&gt;&lt;BR /&gt;I can see and look at the file I need via the library it is in, but I don't know how to write the file name - if that makes sense? I have copy and pasted the actual file name without any extra library information, and that did not work, and now I am at a loss. This file is pretty deep into a bunch of folders, so the path would be something like "sasApp/folder1/201601/estimate/revision/data/FILE I NEED".&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What is the name of the library? Way to reference SAS data sets is to use Libname.Datasetname. Note that the period between the library name and the data set is required. If your set is in the WORK library then you skip the library if you want to. SAS by default assumes that single names are in the Work library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So your code would look something like:&lt;/P&gt;
&lt;PRE&gt;Proc Export data=somelib.thedataset 
    outfile="c:\path\folder\filename.xlsx"
   dbms = xlsx
   replace
;&lt;/PRE&gt;
&lt;P&gt;You may also find that if you right click on a data set that you get a menu with an EXPORT item that would use a wizard that already knows which set you want to export.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The library concept means that SAS code is somewhat operating system independent. Once you have defined a Library in the current operating system syntax then all the SAS code that uses that library knows where to find or place things like data sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not provide an input data set most SAS procedures that expect an input data set will use the last created set. So it is quite possible that if you did not provide any name that something else gets placed into your exported data file.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 21:34:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-determine-proper-file-name-with-Proc-Export/m-p/604309#M76505</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-14T21:34:05Z</dc:date>
    </item>
  </channel>
</rss>

