{"id":206,"date":"2012-06-03T13:38:31","date_gmt":"2012-06-03T13:38:31","guid":{"rendered":"http:\/\/62.131.51.129\/wordpress\/?p=206"},"modified":"2012-06-03T13:38:31","modified_gmt":"2012-06-03T13:38:31","slug":"scheduling-jobs-in-sas","status":"publish","type":"post","link":"http:\/\/archief.van-maanen.com\/?p=206","title":{"rendered":"Scheduling jobs in SAS"},"content":{"rendered":"<p>With SAS, I see SAS DI Studio being more and more employed to write data loading jobs. It is understandable to see this development. Within a data warehouse environment we encounter similar procedures, like reading from a file, adding technical keys, combining tables etc, that could be created with the help of pre-built stones.<br \/>\nWhen such a data loading jobs is written interactively, one could generate the code and create a job that uses this generated code. Such a job looks like:  &#8220;C:\\SAS\\DIserver\\Lev1\\SASMeta\\BatchServer\\sasbatch.bat -log C:\\SAS\\DIserver\\Lev1\\SASMeta\\BatchServer\\Logs\\Flow_Laad_Orders_#Y.#m.#d_#H.#M.#s.log -batch -noterminal -logparm &#8220;rollover=session&#8221;  -sysin C:\\SAS\\DIserver\\Lev1\\SASMeta\\SASEnvironment\\SASCode\\Jobs\\Laad_Orders.sas&#8221; with Laad_Orders.sas being the generated code.<\/p>\n<p>So far, so good.<\/p>\n<p>However, the generated code seems to use some macros and macro-variables that are not defined. They are only defined in the interactive SAS DI Studio. It is unfortunate but we need to use a work-around. Even worse, the work-around as provided by the SAS-Institute does not work. We may solve this issue by adding a few lines on top of the generated code to create the definition for the omitted macr vars and macros. This code seems to work:<\/p>\n<pre>\n%global job_rc trans_rc sqlrc;\n%let sysrc = 0;\n%let job_rc = 0;\n%let trans_rc = 0;\n%let sqlrc = 0;\n\n%macro perfstrt(txnname,metrNam6,METRDEF6);\n%mend;\n%macro perfstop(metrVal6);\n%mend;\n%macro perfend;\n%mend;\n%macro perfinit(applname);\n%mend;\n\n<\/pre>\n<p>Hum, hum, SAS needs to do some extra homework. Hope it is solved in next release,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With SAS, I see SAS DI Studio being more and more employed to write data loading jobs. It is understandable to see this development. Within a data warehouse environment we encounter similar procedures, like reading from a file, adding technical keys, combining tables etc, that could be created with the help of pre-built stones. When [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-206","post","type-post","status-publish","format-standard","hentry","category-nice-to-know"],"_links":{"self":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/206","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=206"}],"version-history":[{"count":0,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/206\/revisions"}],"wp:attachment":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=206"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}