<?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: How to run sas batch job in sas editor ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-batch-job-in-sas-editor/m-p/265661#M52268</link>
    <description>&lt;P&gt;If one program relies on the other programs in order to complete the entire job I would suggest you take your 5 SAS programs and include them in a single new SAS Macro based program which uses the above mentioned %include to execute each program and then write some addition error checking macro code to ensure program 1 ran successfully prior to calling the %include for the second program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then schedule the one program as mentioned above.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Apr 2016 15:03:01 GMT</pubDate>
    <dc:creator>DavidPope</dc:creator>
    <dc:date>2016-04-22T15:03:01Z</dc:date>
    <item>
      <title>How to run sas batch job in sas editor ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-batch-job-in-sas-editor/m-p/265548#M52242</link>
      <description>&lt;P&gt;Dear SAS community users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Right now I have 5 sas programs: the first four collect data and the fifth one picks up data and creates excel report.&lt;/P&gt;
&lt;P&gt;I need to open pc sas to run one by one in order (some programs connect to remote server).&lt;/P&gt;
&lt;P&gt;How can I make a batch program to run in sas environment ? I tried to gather all 5 into windows batch .bat to execute but it failed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;William&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2016 22:58:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-batch-job-in-sas-editor/m-p/265548#M52242</guid>
      <dc:creator>wtien196838</dc:creator>
      <dc:date>2016-04-21T22:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas batch job in sas editor ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-batch-job-in-sas-editor/m-p/265563#M52248</link>
      <description>&lt;P&gt;I've just done something similar to get around some problems sending email with our new 64-bit SAS version. &amp;nbsp;The previous version is still installed, so I created a batch file to execute that version of sas. The syntax was something like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; cd /d [path with program.sas]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; [path for 32-bit sas files]\sasexe -sysin program.sas -config [path for config file]\[filename].cfg&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can run it from the command prompt and, more importantly for my purposes, launch it using the Windows scheduler. &amp;nbsp;I only ran a single program file, but would hope that I could add a 2nd, 3rd and 4th if necessary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps if you posted your code, we could see what may be the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2016 00:41:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-batch-job-in-sas-editor/m-p/265563#M52248</guid>
      <dc:creator>Pamela_JSRCC</dc:creator>
      <dc:date>2016-04-22T00:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas batch job in sas editor ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-batch-job-in-sas-editor/m-p/265564#M52249</link>
      <description>&lt;P&gt;By the way, I was assuming that you are not using Enterprise Guide. &amp;nbsp;It has "process flows" that allow you to group modules together and run with a single "command" from within the EG project. &amp;nbsp;You can also use EG to schedule the process flow to run from the Windows scheduler. &amp;nbsp;That's how my stuff used to run.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2016 00:49:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-batch-job-in-sas-editor/m-p/265564#M52249</guid>
      <dc:creator>Pamela_JSRCC</dc:creator>
      <dc:date>2016-04-22T00:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas batch job in sas editor ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-batch-job-in-sas-editor/m-p/265590#M52258</link>
      <description>If you failed, let us know what you tried, and what symptoms  (error message etc).&lt;BR /&gt;&lt;BR /&gt;A simple way to accomplish this is to do %include from a "master" SAS program. &lt;BR /&gt;&lt;BR /&gt;See how to execute SAS in batch / background in the SAS Companion for you environment. &lt;BR /&gt;There have also been some threads on these communities where you should be able to find directions.</description>
      <pubDate>Fri, 22 Apr 2016 06:03:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-batch-job-in-sas-editor/m-p/265590#M52258</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-04-22T06:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas batch job in sas editor ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-batch-job-in-sas-editor/m-p/265661#M52268</link>
      <description>&lt;P&gt;If one program relies on the other programs in order to complete the entire job I would suggest you take your 5 SAS programs and include them in a single new SAS Macro based program which uses the above mentioned %include to execute each program and then write some addition error checking macro code to ensure program 1 ran successfully prior to calling the %include for the second program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then schedule the one program as mentioned above.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2016 15:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-batch-job-in-sas-editor/m-p/265661#M52268</guid>
      <dc:creator>DavidPope</dc:creator>
      <dc:date>2016-04-22T15:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to run sas batch job in sas editor ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-batch-job-in-sas-editor/m-p/265699#M52284</link>
      <description>&lt;P&gt;Thanks for all suggestions. DavidPope has some ideas which are similar to my thought.&lt;BR /&gt;&lt;BR /&gt;I explain a little about my programs.&lt;BR /&gt;&lt;BR /&gt;I ran PC SAS 9.3 and connect to unix server to get data from oracle database.&lt;BR /&gt;&lt;BR /&gt;A sample of my program as follows:&lt;BR /&gt;--------------------------------------&lt;BR /&gt;&amp;nbsp; options source2 symbolgen mprint;&lt;BR /&gt;&amp;nbsp; %include (macro library);&lt;BR /&gt;&amp;nbsp; %include (sub programs );&lt;BR /&gt;&amp;nbsp;proc printto logs = ... lst=...&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; data aaa ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; proc sql ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect to oracle ...&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit;&lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;&amp;nbsp;...&lt;BR /&gt;&amp;nbsp;&amp;nbsp; data bbb ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set aaa;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; manipulate data ..... ;&lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;proc printto; run;&lt;BR /&gt;------------------------------------&lt;BR /&gt;&lt;BR /&gt;I create window bat file xxx.bat with:&lt;BR /&gt;&lt;BR /&gt;start /w&amp;nbsp; "&amp;lt;sas path&amp;gt;"\sas.exe -sysin "&amp;lt;..path&amp;gt;"\program1.sas -log c:\temp\prg.log -lst c:\temp\prg.lst&lt;BR /&gt;......................................&lt;BR /&gt;&lt;BR /&gt;My problem for this window bat file:&lt;BR /&gt;&lt;BR /&gt;it can not import source of %include inside each sas program&lt;BR /&gt;it can not write out the special log file inside each program&lt;BR /&gt;&lt;BR /&gt;This program is working fine separately in sas environment.&lt;BR /&gt;&lt;BR /&gt;I want to create a sas bat program such that&lt;BR /&gt;&lt;BR /&gt;%include (&amp;lt;path&amp;gt;\program1.sas)&lt;BR /&gt;%include (&amp;lt;path&amp;gt;\program2.sas)&lt;BR /&gt;............................&lt;BR /&gt;and&amp;nbsp; run it in sas environrment (Local SAS), then it connects to remote server.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2016 17:20:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-run-sas-batch-job-in-sas-editor/m-p/265699#M52284</guid>
      <dc:creator>wtien196838</dc:creator>
      <dc:date>2016-04-22T17:20:38Z</dc:date>
    </item>
  </channel>
</rss>

