{"id":969,"date":"2010-06-17T07:29:07","date_gmt":"2010-06-17T00:29:07","guid":{"rendered":"http:\/\/adhi.widjajanto.net\/weblog\/index.php\/2010\/06\/17\/diy_sas_pool_se\/"},"modified":"2015-06-05T14:25:01","modified_gmt":"2015-06-05T07:25:01","slug":"diy_sas_pool_se","status":"publish","type":"post","link":"https:\/\/adhi.widjajanto.net\/blog\/2010\/06\/17\/diy_sas_pool_se\/","title":{"rendered":"DIY: SAS Pool Service"},"content":{"rendered":"<p>What if you need a SAS pool service at your server, but you don&#8217;t have a SAS\/Share or SAS\/Connect license? I&#8217;ve figured out from various sources and build my own pool service.<br \/>\n<strong><u>How we build<\/u><\/strong><br \/>\nInstall SAS as usual and put SAS executable&#8217;s directory to the server global path for script simplification. Create one writable shared directory (named <strong>pool_1<\/strong>). Create another private directory (named <strong>pool_admin<\/strong>) and create one batch file named <strong>pool_1_trigger.bat<\/strong> in the directory which contains:<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@echo off<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cls<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:start<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if not exist p:\\pool_1\\start.sas goto complete<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if exist p:\\pool_1\\processing.txt goto complete<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo Processing&#8230; > p:\\pool_1\\processing.txt<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sas p:\\pool_1\\start.sas<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;del p:\\pool_1\\start.sas<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;del p:\\pool_1\\processing.txt<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:complete<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p:\\pool_admin\\sleep.exe 5<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;goto start<br \/>\nDownload file <strong>sleep.exe<\/strong> from Internet and put it in the <strong>pool_admin<\/strong> directory. I&#8217;ll explain why I use this program later. Register <strong>pool_1_trigger.bat<\/strong> in server&#8217;s <strong>Task Scheduler<\/strong>, set it up to run every server&#8217;s startup. Done.<br \/>\n<strong><u>How it works<\/u><\/strong><br \/>\n<strong>pool_1_trigger.bat<\/strong> will start at server boot. It will stay run caused by infinite loop script (goto start). This loop will look into <strong>pool_1<\/strong> directory for <strong>start.sas<\/strong> existence every 5 seconds (p:\\pool_admin\\sleep.exe 5). Create a complete SAS codes (including libname assignments etc) and save it to <strong>start.sas<\/strong>. When you put the file into <strong>pool_1<\/strong> shared directory, it will automatically executed by <strong>pool_1_trigger.bat<\/strong>. Remember! because <strong>pool_1<\/strong> directory is a writable shared directory, you can submit the codes from anywhere (including another web application server like Coldfusion Server!) and expect the run within 5 seconds. While executing SAS codes, the directory is flagged by processing.txt file. Any other push service can check the pool by checking this file existence.<br \/>\n<strong><u>Why I use sleep.exe<\/u><\/strong><br \/>\nThe pool_1_trigger.bat script will be less complicated if the Task Scheduler can run every second. Unfortunately the fastest loop is one minute. If you can bear wait another minute for sas execution, drop sleep.exe, modify the script, and utilize Task Scheduler.<br \/>\n<strong><u>Is it reliable?<\/u><\/strong><br \/>\nIt&#8217;s DIY! For reliability, I suggest to buy SAS\/Share. But, hey, I&#8217;ve tested this method for several times and haven&#8217;t see any flaws yet.<br \/>\n<strong><u>Further enhancements<\/u><\/strong><br \/>\nClose pool_1 sharing when start.sas exist and reopen when the process finished.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What if you need a SAS pool service at your server, but you don&#8217;t have a SAS\/Share or SAS\/Connect license? I&#8217;ve figured out from various sources and build my own pool service. How we build Install SAS as usual and put SAS executable&#8217;s directory to the server global path for&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[9,8],"tags":[],"class_list":["post-969","post","type-post","status-publish","format-standard","hentry","category-diy","category-it-freaks"],"_links":{"self":[{"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/posts\/969","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/comments?post=969"}],"version-history":[{"count":1,"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/posts\/969\/revisions"}],"predecessor-version":[{"id":1332,"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/posts\/969\/revisions\/1332"}],"wp:attachment":[{"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/media?parent=969"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/categories?post=969"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adhi.widjajanto.net\/blog\/wp-json\/wp\/v2\/tags?post=969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}