<?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: Generate the automated SAS user's report in Excel and send it as an email attachment in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Generate-the-automated-SAS-user-s-report-in-Excel-and-send-it-as/m-p/389828#M25170</link>
    <description>Thanks Quentin. That's an interesting information. I'm gonna try it and see if it works.</description>
    <pubDate>Tue, 22 Aug 2017 14:25:59 GMT</pubDate>
    <dc:creator>Alok_Pal</dc:creator>
    <dc:date>2017-08-22T14:25:59Z</dc:date>
    <item>
      <title>Generate the automated SAS user's report in Excel and send it as an email attachment</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Generate-the-automated-SAS-user-s-report-in-Excel-and-send-it-as/m-p/389679#M25151</link>
      <description>&lt;P&gt;I have a sas program that generates the user's report to list the various roles and groups associated with each users in SAS environment and generates a report in sas enterprise guide. I want this report to be written in excel on my local machine, send it out as an email attachment and schedule the process to run on Friday of every week.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The attached sas program is being used for generating user report. To this code, I tried adding following code (Option 1 &amp;amp; Option 2 below) to get the data in excel on my local machine. But it seems like, either way it is takes the path to my local directory and appends it with that of server's directory path and everytime it fails with following error.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"ERROR: Insufficient authorization to access /opt/sasinside/config/Lev1/SASApp/C:\Temp\UserReport.xls"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want the excel report to be saved on my local machine "C:\Temp" and send it out as an email attachment.&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;&lt;STRONG&gt;Option 1:&lt;/STRONG&gt; Using DATA step.&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;PROC EXPORT DATA= WORK.metadata_users_ready&lt;BR /&gt;OUTFILE= "C:\Temp\UserReport.xls"&lt;BR /&gt;DBMS=csv REPLACE;&lt;BR /&gt;SHEET="Results";&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;&lt;STRONG&gt;Option 2:&lt;/STRONG&gt; Using ODS facility.&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;ods excel file='C:\Temp\UserReport.xls';&lt;BR /&gt;proc print data=WORK.metadata_users_ready;&lt;BR /&gt;run;&lt;BR /&gt;ods excel close;&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 21:54:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Generate-the-automated-SAS-user-s-report-in-Excel-and-send-it-as/m-p/389679#M25151</guid>
      <dc:creator>Alok_Pal</dc:creator>
      <dc:date>2017-08-21T21:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Generate the automated SAS user's report in Excel and send it as an email attachment</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Generate-the-automated-SAS-user-s-report-in-Excel-and-send-it-as/m-p/389681#M25152</link>
      <description>If you're running on a server you have to create the file on the server and then move it down to your computer using  a copy/move task. It's one of the drawbacks of using  a server :(.</description>
      <pubDate>Mon, 21 Aug 2017 21:56:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Generate-the-automated-SAS-user-s-report-in-Excel-and-send-it-as/m-p/389681#M25152</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-21T21:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Generate the automated SAS user's report in Excel and send it as an email attachment</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Generate-the-automated-SAS-user-s-report-in-Excel-and-send-it-as/m-p/389686#M25154</link>
      <description>&lt;P&gt;Check with your SAS Admin - you can email your attachment on the SAS server if emailing from SAS&amp;nbsp;is set up correctly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 23:18:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Generate-the-automated-SAS-user-s-report-in-Excel-and-send-it-as/m-p/389686#M25154</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-08-21T23:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Generate the automated SAS user's report in Excel and send it as an email attachment</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Generate-the-automated-SAS-user-s-report-in-Excel-and-send-it-as/m-p/389812#M25164</link>
      <description>&lt;P&gt;Thanks for your quick response Reeza. Is there's any other way I can do it, may be via DIS job?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 13:49:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Generate-the-automated-SAS-user-s-report-in-Excel-and-send-it-as/m-p/389812#M25164</guid>
      <dc:creator>Alok_Pal</dc:creator>
      <dc:date>2017-08-22T13:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Generate the automated SAS user's report in Excel and send it as an email attachment</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Generate-the-automated-SAS-user-s-report-in-Excel-and-send-it-as/m-p/389825#M25169</link>
      <description>&lt;P&gt;You should be able to generate the Excel file on the server (not on your local PC), and email it from the server (assuming emailing is set up on your server).&amp;nbsp; This should work whether you submit the code as a DI job, EG sesssion,&amp;nbsp;stored process, or whatever way it runs on the server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The key part to remember is your code is running on a server, not your PC.&amp;nbsp; So you can't point to your C: drive from the code, because your (linux?) server doesn't see your local C: drive.&amp;nbsp; The error you get is basically SAS saying "I don't know what C:\Temp is."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, you can try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="%sysfunc(pathname(work))/UserReport.xlsx";
proc print data=WORK.metadata_users_ready;
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That will write a .xlsx file to whatever directory is being used as the work dir of your current session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you're curious where this directory is, you can add:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put %sysfunc(pathname(work));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That directory will be deleted when your SAS session closes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After&amp;nbsp;the Excel file&amp;nbsp;has been written, you should be able to email it as an attachment.&amp;nbsp; There are lots of posts/papers about emailing from SAS, but as suggested, you may need to check with your admin to see how emailing is set up on your server.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 14:15:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Generate-the-automated-SAS-user-s-report-in-Excel-and-send-it-as/m-p/389825#M25169</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2017-08-22T14:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Generate the automated SAS user's report in Excel and send it as an email attachment</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Generate-the-automated-SAS-user-s-report-in-Excel-and-send-it-as/m-p/389828#M25170</link>
      <description>Thanks Quentin. That's an interesting information. I'm gonna try it and see if it works.</description>
      <pubDate>Tue, 22 Aug 2017 14:25:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Generate-the-automated-SAS-user-s-report-in-Excel-and-send-it-as/m-p/389828#M25170</guid>
      <dc:creator>Alok_Pal</dc:creator>
      <dc:date>2017-08-22T14:25:59Z</dc:date>
    </item>
  </channel>
</rss>

