<?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: Physical file does not exist SAS Viya ODS Excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908528#M358522</link>
    <description>&lt;P&gt;Thanks to &lt;A href="https://communities.sas.com/t5/SAS-Programming/Referencing-file-stored-under-SAS-Content-SAS-Viya/td-p/816103" target="_self"&gt;this discussion&lt;/A&gt; I could find a solution that works in my Viya4 environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm still on a steep Viya learning curve so take the following with a grain of salt.&lt;/P&gt;
&lt;P&gt;As I understand it what you see under SAS Content is not a direct view of a file system directory structure but what the SAS Content server surfaces to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;The FILESRVC access method enables you to store and retrieve user content using the SAS Viya Files service.&lt;/EM&gt;"&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/p0qapul7pyz9hmn0zfoefj0c278a.htm#n1gpta2uobo173n1j6vf9qnkqti7" target="_blank" rel="noopener"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/p0qapul7pyz9hmn0zfoefj0c278a.htm#n1gpta2uobo173n1j6vf9qnkqti7&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't write to Public in my environment. The following code works for me for SAS Content folder /Users/&amp;lt;my user&amp;gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let myfile=test.xlsx;

filename out filesrvc 
  folderpath="/Users/&amp;amp;sysuserid" 
  filename="&amp;amp;myfile"
  DEBUG=HTTP
  ;

ods excel 
  file=out
  options(
      sheet_name='Data' 
      sheet_interval='table'
    )
  ;
proc print noobs data=sashelp.class;
run;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Using SAS Studio you can right click onto an object under SAS Content to get the path without the need to type it&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1702853527037.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/91625i509ADD3E0FCBD9FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1702853527037.png" alt="Patrick_0-1702853527037.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 17 Dec 2023 23:53:07 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2023-12-17T23:53:07Z</dc:date>
    <item>
      <title>Physical file does not exist SAS Viya ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908158#M358429</link>
      <description>&lt;P&gt;Hello everyone, I would like to ask a question. I am using SAS Viya 3.5.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found this code about exporting dataset as an excel file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class_age;
by age;
run;
proc sort data=sashelp.class out=class_sex;
by sex;
run;

ods excel file='/home/it3/test.xlsx' options(sheet_name='Data' sheet_interval='table');
proc print noobs data=work.class_age;
run;
proc print noobs data=work.class_sex;
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The path file "/home/it3/test.xlsx" is for &lt;STRONG&gt;it3&lt;/STRONG&gt; user only, which mean that the file can only be accessed by that user. I want the result to be saved on public folder, where everyone can access it. So I change the path location into new one like this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class_age;
by age;
run;
proc sort data=sashelp.class out=class_sex;
by sex;
run;

ods excel file='/Public/1. Test/test.xlsx' options(sheet_name='Data' sheet_interval='table');
proc print noobs data=work.class_age;
run;
proc print noobs data=work.class_sex;
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But the error show up, saying that "Physical file does not exist, /Public/1. Test/test.xlsx". Here's the log.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1    %studio_hide_wrapper;
83   %studio_show_only_notes_wrapper;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
86   proc sort data=sashelp.class out=class_age;
87   by age;
88   run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.CLASS_AGE has 19 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      
89   proc sort data=sashelp.class out=class_sex;
90   by sex;
91   run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.CLASS_SEX has 19 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      
92   
93   ods excel file='/Public/1. Test/test.xlsx' options(sheet_name='Data' sheet_interval='table');
94   proc print noobs data=work.class_age;
95   run;
NOTE: There were 19 observations read from the data set WORK.CLASS_AGE.
NOTE: The PROCEDURE PRINT printed page 9.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.16 seconds
      cpu time            0.18 seconds
      
96   proc print noobs data=work.class_sex;
97   run;
NOTE: There were 19 observations read from the data set WORK.CLASS_SEX.
NOTE: The PROCEDURE PRINT printed page 10.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.16 seconds
      cpu time            0.16 seconds
      
98   ods excel close;
ERROR: Physical file does not exist, /Public/1. Test/test.xlsx.
99   
100  
101  %studio_hide_wrapper;
112  
113  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Where did I do wrong with the path statement? I have administrator authorization, so I'm pretty sure it's not because I don't have the access to the path.&lt;/P&gt;
&lt;P&gt;I've tried inserting URI path too, but it's still showing the same error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the image of SAS Studio where I want to save the file.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/91437iE07F39F2A6AE036C/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.jpg" alt="image.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want the exported file to be saved on the red box.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 09:23:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908158#M358429</guid>
      <dc:creator>adilar39</dc:creator>
      <dc:date>2023-12-15T09:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Physical file does not exist SAS Viya ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908169#M358433</link>
      <description>Do you also get the error when you add the line "ODS _ALL_ CLOSE;" before "ods excel file..."?</description>
      <pubDate>Fri, 15 Dec 2023 11:23:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908169#M358433</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2023-12-15T11:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Physical file does not exist SAS Viya ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908171#M358435</link>
      <description>&lt;P&gt;Does the problem persist if you use a path without blanks?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 11:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908171#M358435</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2023-12-15T11:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Physical file does not exist SAS Viya ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908178#M358441</link>
      <description>&lt;P&gt;SAS Content does not point to a physical path, but to SAS metadata. You can't create any file there, only SAS-specific content.&lt;/P&gt;
&lt;P&gt;You need to have such a public resource set up by your SAS administrator (who must also be able to act as "root" on the underlying UNIX system).&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 12:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908178#M358441</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-12-15T12:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Physical file does not exist SAS Viya ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908210#M358449</link>
      <description>Yes, still the same error.</description>
      <pubDate>Fri, 15 Dec 2023 15:12:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908210#M358449</guid>
      <dc:creator>adilar39</dc:creator>
      <dc:date>2023-12-15T15:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Physical file does not exist SAS Viya ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908211#M358450</link>
      <description>Yes, it's still showing the same error.</description>
      <pubDate>Fri, 15 Dec 2023 15:12:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908211#M358450</guid>
      <dc:creator>adilar39</dc:creator>
      <dc:date>2023-12-15T15:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Physical file does not exist SAS Viya ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908213#M358451</link>
      <description>But I can upload excel files just fine into SAS Contents. Is that not counted as "Create file" too?</description>
      <pubDate>Fri, 15 Dec 2023 15:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908213#M358451</guid>
      <dc:creator>adilar39</dc:creator>
      <dc:date>2023-12-15T15:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Physical file does not exist SAS Viya ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908528#M358522</link>
      <description>&lt;P&gt;Thanks to &lt;A href="https://communities.sas.com/t5/SAS-Programming/Referencing-file-stored-under-SAS-Content-SAS-Viya/td-p/816103" target="_self"&gt;this discussion&lt;/A&gt; I could find a solution that works in my Viya4 environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm still on a steep Viya learning curve so take the following with a grain of salt.&lt;/P&gt;
&lt;P&gt;As I understand it what you see under SAS Content is not a direct view of a file system directory structure but what the SAS Content server surfaces to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;The FILESRVC access method enables you to store and retrieve user content using the SAS Viya Files service.&lt;/EM&gt;"&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/p0qapul7pyz9hmn0zfoefj0c278a.htm#n1gpta2uobo173n1j6vf9qnkqti7" target="_blank" rel="noopener"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/p0qapul7pyz9hmn0zfoefj0c278a.htm#n1gpta2uobo173n1j6vf9qnkqti7&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't write to Public in my environment. The following code works for me for SAS Content folder /Users/&amp;lt;my user&amp;gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let myfile=test.xlsx;

filename out filesrvc 
  folderpath="/Users/&amp;amp;sysuserid" 
  filename="&amp;amp;myfile"
  DEBUG=HTTP
  ;

ods excel 
  file=out
  options(
      sheet_name='Data' 
      sheet_interval='table'
    )
  ;
proc print noobs data=sashelp.class;
run;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Using SAS Studio you can right click onto an object under SAS Content to get the path without the need to type it&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1702853527037.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/91625i509ADD3E0FCBD9FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1702853527037.png" alt="Patrick_0-1702853527037.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Dec 2023 23:53:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908528#M358522</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-12-17T23:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Physical file does not exist SAS Viya ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908542#M358531</link>
      <description>Nice, that works just like I want. Thank you so much!</description>
      <pubDate>Mon, 18 Dec 2023 06:52:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Physical-file-does-not-exist-SAS-Viya-ODS-Excel/m-p/908542#M358531</guid>
      <dc:creator>adilar39</dc:creator>
      <dc:date>2023-12-18T06:52:01Z</dc:date>
    </item>
  </channel>
</rss>

