<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Royalsouvenir's SAS Blog</title>
	<atom:link href="http://royalsouvenir.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://royalsouvenir.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sun, 10 May 2009 00:38:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='royalsouvenir.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/02d9a6429c8657524af7645f911f780d?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Royalsouvenir's SAS Blog</title>
		<link>http://royalsouvenir.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://royalsouvenir.wordpress.com/osd.xml" title="Royalsouvenir&#039;s SAS Blog" />
	<atom:link rel='hub' href='http://royalsouvenir.wordpress.com/?pushpress=hub'/>
		<item>
		<title>SAS Syntax Highlighter</title>
		<link>http://royalsouvenir.wordpress.com/2009/05/10/sas-syntax-highlighter/</link>
		<comments>http://royalsouvenir.wordpress.com/2009/05/10/sas-syntax-highlighter/#comments</comments>
		<pubDate>Sun, 10 May 2009 00:38:02 +0000</pubDate>
		<dc:creator>royalsouvenir</dc:creator>
				<category><![CDATA[SAS]]></category>

		<guid isPermaLink="false">http://royalsouvenir.wordpress.com/?p=27</guid>
		<description><![CDATA[Hi, I have been a bit quiet lately&#8230; Lot&#8217;s of work!!!! I have been working on a brush for Alex Gorbatchev&#8217;s Syntax Highlighter Javascript plugin. I am close to a viable release for it. It will be available for download from my Google Code project page later this week. At present, I have it successfully [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=royalsouvenir.wordpress.com&amp;blog=6954111&amp;post=27&amp;subd=royalsouvenir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />
I have been a bit quiet lately&#8230; Lot&#8217;s of work!!!!</p>
<p>I have been working on a brush for Alex Gorbatchev&#8217;s <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter">Syntax Highlighter</a> Javascript plugin.  I am close to a viable release for it.  It will be available for download from my Google Code project page later this week.  At present, I have it successfully highlighting;</p>
<ul>
<li>Comments (except the sas specifc *; lexicon)</li>
<li>Data Step and methods</li>
<li>All Base / Access / Graph procs</li>
<li>Macros (sas supplied and syntax highlighting within custom macros!!!)</li>
<li>libnames</li>
<li>ods</li>
<li>strings</li>
<li>formats/informats</li>
<li>variable declarations</li>
</ul>
<p>A screenshot is below showing the highlighting.<br />
<img src="http://royalsouvenir.files.wordpress.com/2009/05/syntax_highlighter_sas.png?w=510" alt="SAS Language in Syntax Highlighter" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/royalsouvenir.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/royalsouvenir.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/royalsouvenir.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/royalsouvenir.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/royalsouvenir.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/royalsouvenir.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/royalsouvenir.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/royalsouvenir.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/royalsouvenir.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/royalsouvenir.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/royalsouvenir.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/royalsouvenir.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/royalsouvenir.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/royalsouvenir.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=royalsouvenir.wordpress.com&amp;blog=6954111&amp;post=27&amp;subd=royalsouvenir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://royalsouvenir.wordpress.com/2009/05/10/sas-syntax-highlighter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/00e7707a653fc73b5a369228e92fff11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">royalsouvenir</media:title>
		</media:content>

		<media:content url="http://royalsouvenir.files.wordpress.com/2009/05/syntax_highlighter_sas.png" medium="image">
			<media:title type="html">SAS Language in Syntax Highlighter</media:title>
		</media:content>
	</item>
		<item>
		<title>SAS and Jquery Make for Nice Friends Pt 1</title>
		<link>http://royalsouvenir.wordpress.com/2009/03/18/sas-and-jquery-make-for-nice-friends-pt-1/</link>
		<comments>http://royalsouvenir.wordpress.com/2009/03/18/sas-and-jquery-make-for-nice-friends-pt-1/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 12:12:38 +0000</pubDate>
		<dc:creator>royalsouvenir</dc:creator>
				<category><![CDATA[SAS]]></category>
		<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[Intrnet]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Stored Process]]></category>

		<guid isPermaLink="false">http://royalsouvenir.wordpress.com/?p=18</guid>
		<description><![CDATA[SAS has some pretty archaic and limited functionality when it comes to playing with the web browser. Either you need to do A LOT of programming or settle for the vanilla offerings of SAS.  I will be doing a short series of showing how you can use Jquery to help bring SAS content into a 2.0 world.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=royalsouvenir.wordpress.com&amp;blog=6954111&amp;post=18&amp;subd=royalsouvenir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You can harness the power of the awesome <a href="http://jquery.com" target="_blank">Jquery</a> library and AJAX (asynchronous responses) with SAS.  (Link opens in new window).</p>
<p>Consider the following;</p>
<p>You are using a SAS <a href="http://support.sas.com/documentation/onlinedoc/inttech/index.html" target="_blank">Stored Process</a> to return some kind of data as a web page (ods or data _null_ writing to _webout).</p>
<p>You can use jquery&#8217;s  Ajax functions ($.get,$.post $.ajax) to call your SAS stored process and return the response to a portion of your web page or use the returning data and manipulate it how you see fit.</p>
<p>(Forgive my Java script any js boffins out there&#8230;.I&#8217;m a SAS programmer. :p)</p>
<h5>Jquery Load</h5>
<pre>$(document).ready.function(){
   $('#htmlElementId').click(function(){
      var var1 = $('#anotherHtmlElementId').val(); //Load content of a HTML Element into a variable
      $('#htmlElementToLoadContentTo').empty();
      $('#htmlElementToLoadContentTo').load('your stored process server address:8080/do',{
            _program:'SAS PROGRAM NAME GOES HERE',
            macroVariable1:'your value',
            macroVariable2:'your value',
            macroVariable3:var1 //This is the value of variable 1
      });
      return false;
   });
});</pre>
<p> </p>
<p>When the HTML element with the ID of  &#8217;htmlElementId&#8217; is clicked (it can be any kind of element) do the following;</p>
<ul>
<li>Empties the contents of the HTML element with the ID of  &#8217;htmlElementToLoadContentTo&#8217;</li>
<li>Post a request to the SAS stored process server passing with it a querystring composed of the json data after the SAS stored process server address.</li>
<li>Return the results to the page and load the content into the HTML element with the ID of &#8216;htmlElementToLoadContentTo&#8217;.</li>
</ul>
<p>Some examples of where this is useful for SAS programmers;</p>
<ul>
<li>Using SAS Stored Processes or SAS Inrnet to push data to and from SAS into a browser.</li>
<li>Building in browser Dashboards (I hate proc gpanel and using htmlpanel tagsets) and letting only portions of the page refresh. (this could be combined with javascript&#8217;s onTimer event for example).</li>
<li>Dishing up multiple ods pages in a format outside of SAS&#8217;s archaic Frames mechanism.</li>
<li>Following good architectural principles by separating ui, business logic and data correctly.</li>
</ul>
<p>Check out the jquery library soon.  I will be posting more examples over coming weeks as I&#8217;m having heaps of fun getting the two to work together.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/royalsouvenir.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/royalsouvenir.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/royalsouvenir.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/royalsouvenir.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/royalsouvenir.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/royalsouvenir.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/royalsouvenir.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/royalsouvenir.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/royalsouvenir.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/royalsouvenir.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/royalsouvenir.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/royalsouvenir.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/royalsouvenir.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/royalsouvenir.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=royalsouvenir.wordpress.com&amp;blog=6954111&amp;post=18&amp;subd=royalsouvenir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://royalsouvenir.wordpress.com/2009/03/18/sas-and-jquery-make-for-nice-friends-pt-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/00e7707a653fc73b5a369228e92fff11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">royalsouvenir</media:title>
		</media:content>
	</item>
		<item>
		<title>Date Dimension</title>
		<link>http://royalsouvenir.wordpress.com/2009/03/15/date-dimension/</link>
		<comments>http://royalsouvenir.wordpress.com/2009/03/15/date-dimension/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 04:34:40 +0000</pubDate>
		<dc:creator>royalsouvenir</dc:creator>
				<category><![CDATA[SAS]]></category>
		<category><![CDATA[Data Warehousing]]></category>
		<category><![CDATA[datastep]]></category>
		<category><![CDATA[OLAP]]></category>

		<guid isPermaLink="false">http://royalsouvenir.wordpress.com/?p=11</guid>
		<description><![CDATA[When data warehousing or building OLAP, one of the most used tables will be a date dimension.  This is my standard start for date dimensions.  This shows dates from 1st Jan 1960 to 31st Dec 2099.  Alter the looping to suit your needs. Data dim_date (drop=i); format date_pk ddmmyy10. day_name downame. month_name monname. date_long weekdate25. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=royalsouvenir.wordpress.com&amp;blog=6954111&amp;post=11&amp;subd=royalsouvenir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When data warehousing or building OLAP, one of the most used tables will be a date dimension.  This is my standard start for date dimensions.  This shows dates from 1st Jan 1960 to 31st Dec 2099.  Alter the looping to suit your needs.</p>
<pre>
Data dim_date (drop=i);
    format  date_pk ddmmyy10.
            day_name downame.
            month_name monname.
            date_long weekdate25.
            weekend_indicator $5.;

    i=0;
    do until (i=51135);
        date_pk=i;

        *Calendar Year Stuff;
        calendar_yr = year(i);
        ms_date_serial=i+21916;
        unix_date_serial=i+21916;
        if month(i)&lt;=6 then calendar_biannual=1; else calendar_biannual=2;
        calendar_qtr = qtr(i);
        calendar_month=month(i);
        calendar_week=intck(’WEEK.1′,mdy(1,1,year(i)),i);
        calendar_day=weekDay(i);
        day_name=i;
        month_name=i;
        date_long=i;
        workplace_day=weekDay(i)-1;

        calendar_yr_qtr=compbl(left(calendar_yr||’, QTR ‘||calendar_qtr));
        if compbl(left(calendar_biannual))=1 then calendar_yr_half = 1||’st calendar half of ‘||compbl(left(calendar_yr)); else calendar_yr_half = 2||’nd calendar half of ‘||compbl(left(calendar_yr));
            calendar_yr_mth=compbl(left(calendar_yr||’, MTH ‘||calendar_month));

        calendar_yr_week=compbl(left(calendar_yr||’, WK ‘||calendar_week));
        calendar_mth_week=compbl(left(’MONTH ‘||calendar_month||’, WK’||calendar_week));

        Select (Month(i));
            When (1) season=’Summer’;
            When (2) season=’Summer’;
            When (3) season=’Autumn’;
            When (4) season=’Autumn’;
            When (5) season=’Autumn’;
            When (6) season=’Winter’;
            When (7) season=’Winter’;
            When (8) season=’Winter’;
            When (9) season=’Spring’;
            When (10)season=’Spring’;
            When (11)season=’Spring’;
            When (12)season=’Summer’;
            Otherwise;
        End;

        *Financial Year Dates;
        if month(i)=3 then financial_qtr=qtr(i)-2; else financial_qtr=qtr(i)+2;
        if month(i) &gt;=7 then financial_month=month(i)-6;else financial_month=month(i)+6;
        if month(i) &gt;=7 then fy_year_halfyr = 1||’st Half of ‘||financial_year; else fy_year_halfyr = 2||’nd Half of ‘||financial_year;
        fy_year_qtr=compbl(left(financial_year||’, QTR ‘||financial_qtr));
        fy_year_month=compbl(left(financial_year||’, MONTH ‘||financial_month));

        *indicators/misc;
        If weekday(i) in (1,7) then weekend_indicator=’TRUE’; else weekend_indicator=’FALSE’;

        *Date Flags Forcing this dimension to refresh daily;
        if year(i) eq year(Today()) then calendar_ytd_flag=1; else calendar_ytd_flag=0;
        if year(i) eq year(Today()) and month(i) le 6 then fy_ytd_flag=1;
            else if year(i) eq year(Today())-1 and month(i) ge 7 then fy_ytd_flag=1;
            else fy_ytd_flag=0;

        /*filters:  Used for Creating Auto Date Filters for Cubes.  Requires Daily Refresh*/
        if i=today()-1 then prev_day_flag=1; else prev_day_flag=0;
        if i&gt;today()-7 and i today()-183 then last_six_mth_flag=1; else last_six_mth_flag=0;
        if i&gt;today()-366 then last_12_mth_flag=1; else last_12_mth_flag=0;
        output;
        i=i+1;
   end;
run
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/royalsouvenir.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/royalsouvenir.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/royalsouvenir.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/royalsouvenir.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/royalsouvenir.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/royalsouvenir.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/royalsouvenir.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/royalsouvenir.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/royalsouvenir.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/royalsouvenir.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/royalsouvenir.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/royalsouvenir.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/royalsouvenir.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/royalsouvenir.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=royalsouvenir.wordpress.com&amp;blog=6954111&amp;post=11&amp;subd=royalsouvenir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://royalsouvenir.wordpress.com/2009/03/15/date-dimension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/00e7707a653fc73b5a369228e92fff11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">royalsouvenir</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Processes Reporting</title>
		<link>http://royalsouvenir.wordpress.com/2009/03/15/windows-processes-reporting/</link>
		<comments>http://royalsouvenir.wordpress.com/2009/03/15/windows-processes-reporting/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 03:55:29 +0000</pubDate>
		<dc:creator>royalsouvenir</dc:creator>
				<category><![CDATA[SAS]]></category>

		<guid isPermaLink="false">http://royalsouvenir.wordpress.com/2009/03/15/windows-processes-reporting/</guid>
		<description><![CDATA[I find myself doing more and more platform admin style work everyday. Recently I needed to do some monitoring of who was using what processes on our server. I came up with this.   %let file0 = %nrquote(C:InetpubwwwrootSASproc0.csv); %let file1 = %nrquote(C:InetpubwwwrootSASproc1.csv); %let cmd0 = %nrquote(tasklist /v /fo csv &#62;)&#38;file0; %let cmd1 = %nrquote(tasklist /svc [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=royalsouvenir.wordpress.com&amp;blog=6954111&amp;post=9&amp;subd=royalsouvenir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I find myself doing more and more platform admin style work everyday.  Recently I needed to do some monitoring of who was using what processes on our server.  I came up with this.</p>
<p> </p>
<p>%let file0 = %nrquote(C:InetpubwwwrootSASproc0.csv);<br />
%let file1 = %nrquote(C:InetpubwwwrootSASproc1.csv);<br />
%let cmd0 = %nrquote(tasklist /v /fo csv &gt;)&amp;file0;<br />
%let cmd1 = %nrquote(tasklist /svc /fo csv &gt;)&amp;file1;<br />
%let batchFile = %nrquote(C:InetpubwwwrootSASproc.bat);</p>
<p>%let reportFileName0 = %nrquote(tasklists.html);<br />
%let reportFileName1 = %nrquote(tasklistdetail.html);<br />
%let reportFileName2 = %nrquote(tasklistdetailsas.html);<br />
%let reportFile0 = %nrquote(C:InetpubwwwrootSAS)&amp;reportFileName0;<br />
%let reportFile1 = %nrquote(C:InetpubwwwrootSAS)&amp;reportFileName1;<br />
%let reportFile2 = %nrquote(C:InetpubwwwrootSAS)&amp;reportFileName2;<br />
%let odsStyle = Meadow;</p>
<p>%let server = yourservername;<br />
options noxwait noxsync;</p>
<p>/*&#8211; Create a Batch File to Run tasklist &#8211;*/<br />
data _null_;<br />
file &#8220;&amp;batchFile&#8221;;<br />
put &#8220;&amp;cmd1&#8243;;<br />
put &#8220;&amp;cmd0&#8243;;<br />
run;</p>
<p>/*&#8211; Run the Batch File.  Files go to TRANSIT &#8211;*/<br />
systask cmd &#8220;&amp;batchFile&#8221; wait;run;quit;</p>
<p>/*&#8211; Import the Data and Join It Together &#8211;*/<br />
data tasklist0;<br />
length 	server $11 run_dt 8 run_tm 8 run_dt_tm 8 image_name $50 pid 8 session_name $50 session_num 8 memory_kb 8 mem_usage $25 status $15<br />
user_name $50 cpu $10 cpu_time 8 window_title $225;<br />
infile &#8220;&amp;file0&#8243; dlm=&#8217;,&#8217; dsd missover lrecl=32637 firstobs=2;<br />
input	image_name $ pid  session_name $ session_num  mem_usage $ status $<br />
user_name $ cpu $ window_title $;</p>
<p>drop cpu mem_usage;<br />
format  run_dt yymmdd10. run_tm timeampm10. run_dt_tm datetime20. cpu_time time. memory_kb comma9.;<br />
cpu_time = input(cpu,time.);<br />
server=&#8221;&amp;server&#8221;;<br />
run_dt = date();<br />
run_tm = time();<br />
run_dt_tm = datetime();<br />
memory_kb = input(scan(mem_usage,1,&#8217; &#8216;),comma9.);</p>
<p>run;quit;</p>
<p>data tasklist1;<br />
length image_name $50 pid 8 services $500;<br />
infile &#8220;&amp;file1&#8243; dlm=&#8217;,&#8217; dsd missover lrecl=32637 firstobs=2;<br />
input image_name $ pid services $;<br />
services = %nrquote(services);<br />
run;quit;</p>
<p>proc sql noprint;<br />
create table report0 as<br />
select a.*,b.services,1 as n from tasklist0 a, tasklist1 b where a.pid=b.pid;<br />
quit;</p>
<p>/*&#8211; Full List &#8211;*/<br />
proc sort data=report0;<br />
by user_name;<br />
run;</p>
<p>/*&#8211; Summary &#8211;*/<br />
proc sql noprint;<br />
create table summary0 as<br />
select<br />
server,<br />
user_name,<br />
run_dt,<br />
run_tm,<br />
image_name,<br />
sum(memory_kb) as total_memory_kb format=comma9.,<br />
sum(memory_kb)/1024 as total_memory_mb format=comma9.,<br />
sum(n) as total_processes format=comma9.<br />
from<br />
report0<br />
group by<br />
server,<br />
user_name,<br />
run_dt,<br />
run_tm,<br />
image_name<br />
;<br />
quit;</p>
<p>proc sql noprint;<br />
create table summary1 as<br />
select<br />
server,user_name,run_dt, sum(total_memory_kb) as total_memory_kb format=comma9.,<br />
sum(total_memory_mb) as total_memory_mb format=comma9.,sum(total_processes) as total_processes format=comma9.<br />
from<br />
summary0<br />
group by<br />
server,user_name,run_dt<br />
;<br />
quit;</p>
<p>proc sql noprint;<br />
create table summary2 as<br />
select<br />
server,user_name,run_dt, sum(total_memory_kb) as total_memory_kb format=comma9.,<br />
sum(total_memory_mb) as total_memory_mb format=comma9.,sum(total_processes) as total_processes format=comma9.<br />
from<br />
summary0<br />
where<br />
image_name = &#8216;sas.exe&#8217;<br />
group by<br />
server,user_name,run_dt<br />
;<br />
quit;<br />
data summary1;<br />
set summary1;<br />
num = _n_-1;</p>
<p>drop num links;<br />
user = &#8216;<a>&#8216;||user_name||&#8217;</a>&#8216;;<br />
run;</p>
<p>data summary2;<br />
set summary2;<br />
num = _n_-1;<br />
drop num;<br />
user = &#8216;<a>&#8216;||user_name||&#8217;</a>&#8216;;<br />
run;</p>
<p>/*&#8211; Reports ODS &#8211;*/<br />
ods html file=&#8221;&amp;reportFile0&#8243; style=&amp;odsStyle gpath=&#8217;C:Inetpubwwwrootsas&#8217;;</p>
<p>proc print data=summary1 noobs;<br />
title1 &#8216;Currently Running Processes &#8211; Summary 1&#8242;;<br />
sum total_memory_kb total_memory_mb total_processes;<br />
run;</p>
<p>proc print data=summary2 noobs;<br />
title1 &#8216;Currently Running SAS Processes &#8211; Summary 1&#8242;;<br />
sum total_memory_kb total_memory_mb total_processes;<br />
run;</p>
<p>proc print data=summary0 noobs;<br />
title1 &#8216;Currently Running Processes &#8211; Summary 2&#8242;;<br />
sum total_memory_kb total_memory_mb total_processes;<br />
run;<br />
ods html close;</p>
<p>ods html file=&#8221;&amp;reportFile1&#8243; style=&amp;odsStyle;</p>
<p>proc print data=report0 noobs;<br />
title1 &#8216;Running Processes by User.&#8217;;<br />
by user_name;<br />
sumby user_name;<br />
sum memory_kb cpu_time n;<br />
var server run_dt_tm image_name window_title pid session_name  status services memory_kb cpu_time n;<br />
run;</p>
<p>ods html close;</p>
<p>ods html file=&#8221;&amp;reportFile2&#8243; style=&amp;odsStyle;</p>
<p>proc print data=report0(where=(image_name in(&#8216;sas.exe&#8217;)))noobs;<br />
title1 &#8216;Running Processes by User.&#8217;;<br />
by user_name;<br />
sumby user_name;<br />
sum memory_kb cpu_time n;<br />
var server run_dt_tm image_name window_title pid session_name  status services memory_kb cpu_time n;<br />
run;</p>
<p>ods html close;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/royalsouvenir.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/royalsouvenir.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/royalsouvenir.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/royalsouvenir.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/royalsouvenir.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/royalsouvenir.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/royalsouvenir.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/royalsouvenir.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/royalsouvenir.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/royalsouvenir.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/royalsouvenir.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/royalsouvenir.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/royalsouvenir.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/royalsouvenir.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=royalsouvenir.wordpress.com&amp;blog=6954111&amp;post=9&amp;subd=royalsouvenir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://royalsouvenir.wordpress.com/2009/03/15/windows-processes-reporting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/00e7707a653fc73b5a369228e92fff11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">royalsouvenir</media:title>
		</media:content>
	</item>
		<item>
		<title>Welcome</title>
		<link>http://royalsouvenir.wordpress.com/2009/03/14/welcome/</link>
		<comments>http://royalsouvenir.wordpress.com/2009/03/14/welcome/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 10:59:46 +0000</pubDate>
		<dc:creator>royalsouvenir</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[SAS]]></category>

		<guid isPermaLink="false">http://royalsouvenir.wordpress.com/2009/03/14/welcome/</guid>
		<description><![CDATA[Hi This is my blog. It&#8217;s mainly about SAS and programming. It will also include some content about myself. I hope you enjoy and learn.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=royalsouvenir.wordpress.com&amp;blog=6954111&amp;post=5&amp;subd=royalsouvenir&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi This is my blog.  It&#8217;s mainly about SAS and programming.  It will also include some content about myself.  I hope you enjoy and learn.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/royalsouvenir.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/royalsouvenir.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/royalsouvenir.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/royalsouvenir.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/royalsouvenir.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/royalsouvenir.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/royalsouvenir.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/royalsouvenir.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/royalsouvenir.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/royalsouvenir.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/royalsouvenir.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/royalsouvenir.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/royalsouvenir.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/royalsouvenir.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=royalsouvenir.wordpress.com&amp;blog=6954111&amp;post=5&amp;subd=royalsouvenir&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://royalsouvenir.wordpress.com/2009/03/14/welcome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/00e7707a653fc73b5a369228e92fff11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">royalsouvenir</media:title>
		</media:content>
	</item>
	</channel>
</rss>
