<?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 Department reports in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Department-reports/m-p/4283#M1359</link>
    <description>I have some requirement where I have to generate reports for different departments&lt;BR /&gt;
&lt;BR /&gt;
I have a project in Enterprise Guide. On executing this project a txt report is generated that has data of multiple departments. A Stored Process is created out of the EG project and scheduled.&lt;BR /&gt;
&lt;BR /&gt;
Is there any mechanism where this scheduled stored process when run sends the department output to individual departments mail id.&lt;BR /&gt;
&lt;BR /&gt;
Stored Process when run gives consolidated output as shown&lt;BR /&gt;
=============================================&lt;BR /&gt;
Department         Emp          Salary&lt;BR /&gt;
10                      1001          50000&lt;BR /&gt;
10                      1002          40000&lt;BR /&gt;
20                      1003          50000&lt;BR /&gt;
20                      1004          55000&lt;BR /&gt;
30                      1005          50000&lt;BR /&gt;
30                      1006          50500&lt;BR /&gt;
40                      1007          50400&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Requirement&lt;BR /&gt;
=========================&lt;BR /&gt;
Department 10 user should receive the below output in email&lt;BR /&gt;
&lt;BR /&gt;
Department         Emp          Salary&lt;BR /&gt;
10                      1001          50000&lt;BR /&gt;
10                      1002          40000&lt;BR /&gt;
&lt;BR /&gt;
Department 20 user should receive the below output in email&lt;BR /&gt;
Department         Emp          Salary&lt;BR /&gt;
20                      1003          50000&lt;BR /&gt;
20                      1004          55000&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Department 30 user should receive the below output in email&lt;BR /&gt;
Department         Emp          Salary&lt;BR /&gt;
30                      1005          50000&lt;BR /&gt;
30                      1006          50500&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Department 40 user should receive the below output in email&lt;BR /&gt;
Department         Emp          Salary&lt;BR /&gt;
40                      1007          50400&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Second part of the requirement is to send this output to individual department printers&lt;BR /&gt;
&lt;BR /&gt;
Whats the power of SAS with such a requirement.</description>
    <pubDate>Wed, 22 Aug 2007 21:55:14 GMT</pubDate>
    <dc:creator>SanjayM</dc:creator>
    <dc:date>2007-08-22T21:55:14Z</dc:date>
    <item>
      <title>Department reports</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Department-reports/m-p/4283#M1359</link>
      <description>I have some requirement where I have to generate reports for different departments&lt;BR /&gt;
&lt;BR /&gt;
I have a project in Enterprise Guide. On executing this project a txt report is generated that has data of multiple departments. A Stored Process is created out of the EG project and scheduled.&lt;BR /&gt;
&lt;BR /&gt;
Is there any mechanism where this scheduled stored process when run sends the department output to individual departments mail id.&lt;BR /&gt;
&lt;BR /&gt;
Stored Process when run gives consolidated output as shown&lt;BR /&gt;
=============================================&lt;BR /&gt;
Department         Emp          Salary&lt;BR /&gt;
10                      1001          50000&lt;BR /&gt;
10                      1002          40000&lt;BR /&gt;
20                      1003          50000&lt;BR /&gt;
20                      1004          55000&lt;BR /&gt;
30                      1005          50000&lt;BR /&gt;
30                      1006          50500&lt;BR /&gt;
40                      1007          50400&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Requirement&lt;BR /&gt;
=========================&lt;BR /&gt;
Department 10 user should receive the below output in email&lt;BR /&gt;
&lt;BR /&gt;
Department         Emp          Salary&lt;BR /&gt;
10                      1001          50000&lt;BR /&gt;
10                      1002          40000&lt;BR /&gt;
&lt;BR /&gt;
Department 20 user should receive the below output in email&lt;BR /&gt;
Department         Emp          Salary&lt;BR /&gt;
20                      1003          50000&lt;BR /&gt;
20                      1004          55000&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Department 30 user should receive the below output in email&lt;BR /&gt;
Department         Emp          Salary&lt;BR /&gt;
30                      1005          50000&lt;BR /&gt;
30                      1006          50500&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Department 40 user should receive the below output in email&lt;BR /&gt;
Department         Emp          Salary&lt;BR /&gt;
40                      1007          50400&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Second part of the requirement is to send this output to individual department printers&lt;BR /&gt;
&lt;BR /&gt;
Whats the power of SAS with such a requirement.</description>
      <pubDate>Wed, 22 Aug 2007 21:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Department-reports/m-p/4283#M1359</guid>
      <dc:creator>SanjayM</dc:creator>
      <dc:date>2007-08-22T21:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Department reports</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Department-reports/m-p/4284#M1360</link>
      <description>Well Grasshopper, I realise that birds are your enemies, and that any reduction in their population might be advantageous to your family.  Killing trees for production of paper also reduces birds nesting sites, but that is a poor reason to use a lot of paper.  The world is an holistic environment and there is a place for everything in the Lord G*d's realm. &lt;WEREN&gt;&lt;BR /&gt;
&lt;BR /&gt;
Seriously though, I strongly counsel against automatically sending output to a printer unless there are stringent controls to prevent the printer bins being emptied by an accidentally oversize output file.  Almost nobody reads 100 pages of overblown output and you just wasted trees and carbon.  However, if you can be sure that you won't kill a tree (by trapping and limiting allowable output quantity), then  the PrintTo Procedure allows output to be routed to a destination by specifying the network address of the printer.&lt;BR /&gt;
&lt;BR /&gt;
Note that the printer must be reachable from the server, so there may be problems sending to a Windows defined printer from a Unix Application server.  Since you will invoke the procedure and close it around the output step, you will need to divide the data set and send it in pieces to the PrintTo and Report steps.&lt;BR /&gt;
&lt;BR /&gt;
As for emailing results (which is a much more conservative and attractive solution), assuming your application server has the capability to send email through your SMTP accessible Post Office server, then simple data step directives will allow you to define and change email addresses as you process the data in a single data step.  With a format procedure you can map department values to email addresses and switch email destinations as you step through the data.&lt;BR /&gt;
&lt;BR /&gt;
A tutorial on "Emailing from your SAS session, how and why" from SUGI 31 is available on the SAS Support web site.  Look towards the end where I specified changes of destinations according to strata of house prices.  Your code would be very similar.&lt;BR /&gt;
&lt;BR /&gt;
Kind regards&lt;BR /&gt;
&lt;BR /&gt;
David&lt;/WEREN&gt;</description>
      <pubDate>Fri, 24 Aug 2007 03:02:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Department-reports/m-p/4284#M1360</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-08-24T03:02:01Z</dc:date>
    </item>
  </channel>
</rss>

