<?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: Using Windows Task Scheduler to run a program with Gplot - hangs! in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522745#M4493</link>
    <description>&lt;P&gt;And here is the log when running the sas program interactively.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Dec 2018 23:09:21 GMT</pubDate>
    <dc:creator>canna_guy_scott</dc:creator>
    <dc:date>2018-12-19T23:09:21Z</dc:date>
    <item>
      <title>Using Windows Task Scheduler to run a program with Gplot - hangs!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522687#M4481</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the end of the sas program below, an email is generated and send out with a pdf&amp;nbsp; containing a GPlot attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data dummy1;&lt;BR /&gt;input&amp;nbsp; admin $char10. x y z;&lt;BR /&gt;datalines;&lt;BR /&gt;12-12-1952&amp;nbsp; 45 22 1 &amp;nbsp;&lt;BR /&gt;12-13-1952&amp;nbsp; 55 32 1 &amp;nbsp;&lt;BR /&gt;12-14-1952&amp;nbsp; 66 35 2 &amp;nbsp;&lt;BR /&gt;12-15-1952&amp;nbsp; 63 30 2 &amp;nbsp;&lt;BR /&gt;12-16-1952&amp;nbsp; 65 34 4 &amp;nbsp;&lt;BR /&gt;12-17-1952&amp;nbsp; . . . &amp;nbsp;&lt;BR /&gt;12-18-1952&amp;nbsp; . . .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;12-19-1952&amp;nbsp; . . .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;options&amp;nbsp; missing=' ' nocenter&amp;nbsp; papersize=legal orientation=portrait nodate nonumber leftmargin=0.3in rightmargin=0.3in;&lt;BR /&gt;ods escapechar="^";&lt;BR /&gt;title;&lt;BR /&gt;ODS PDF file="C:\&amp;lt;insert your path&amp;gt;\file_with_gplot.pdf" startpage=no;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ods text=" ";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ods text= "^{style [just=left font=('calibri', 12pt, bold)] Data}";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ods text=" ";&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc report data=dummy1 nowd split='~' nowd style(column)={cellheight=0.17in} style(header)={cellheight=0.25in fontsize=6pt fontfamily='calibri'} style(column)=[ fontfamily='calibri' fontsize=6pt];&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; title;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; column admin x y z;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; define admin/ display "Date";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; define x/ display "% All" style(column)=[cellwidth=0.7in just=center];&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; define y/ display "% Most" style(column)=[cellwidth=0.7in just=center];&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; define z/ display "% Some" style(column)=[cellwidth=0.7in just=center];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;goptions reset=global gunit=pct border cback=white&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; colors=(black blue green red)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ftitle=swissb ftext=swissb htitle=3.5 htext=2 vsize=3 hsize=3.5&amp;nbsp; horigin=0 vorigin=6;&lt;BR /&gt;&lt;BR /&gt;title1 'Gplot of X, Y, Z over Date';&lt;BR /&gt;&lt;BR /&gt;symbol1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color=red&amp;nbsp;&amp;nbsp; interpol=join value=dot height=3;&lt;BR /&gt;symbol2 font=marker color=blue&amp;nbsp; interpol=join value=C&amp;nbsp;&amp;nbsp; height=3;&lt;BR /&gt;symbol3 font=marker color=green interpol=join value=X&amp;nbsp;&amp;nbsp; height=3;&lt;BR /&gt;&lt;BR /&gt;axis1 label=("The" justify=c&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Date")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; major=(height=2) minor=(height=1) width=3;&lt;BR /&gt;axis2 order=(0 to 100 by 10) offset=(0,0) label=none major=(height=2) minor=(height=1) width=3;&lt;BR /&gt;legend1 label=none shape=symbol(4,2) position=(top center inside) mode=share;&lt;BR /&gt;&lt;BR /&gt;proc gplot data=dummy1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; plot x*admin y*admin z*admin / overlay legend=legend1 haxis=axis1 hminor=4 vaxis=axis2 vminor=1;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;ODS PDF close;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;FILENAME OUTBOX EMAIL&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;TO&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;=&amp;nbsp;&amp;nbsp; &amp;nbsp;("&amp;lt;insert_your_email&amp;gt;@&amp;lt;xyz.com&amp;gt;")&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;REPLYTO&amp;nbsp;&amp;nbsp; &amp;nbsp;=&amp;nbsp;&amp;nbsp; &amp;nbsp;("&amp;lt;insert_your_email&amp;gt;@&amp;lt;xyz.com&amp;gt;")&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SUBJECT&amp;nbsp;&amp;nbsp; &amp;nbsp;=&amp;nbsp;&amp;nbsp; &amp;nbsp;("Test - pdf file with embedded Gplot ")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ATTACH&amp;nbsp; =&amp;nbsp;&amp;nbsp; ("C:\&amp;lt;insert your path&amp;gt;\file_with_gplot.pdf");&lt;BR /&gt;DATA _NULL_;&lt;BR /&gt;&amp;nbsp; FILE OUTBOX;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;PUT ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;PUT %SYSFUNC(COMPBL("This email was generated via sas program."));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;PUT ;&lt;BR /&gt;RUN;&lt;BR /&gt;FILENAME OUTBOX CLEAR;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;data _null_; put '** the SAS job is now finished'; run;&lt;BR /&gt;data _null_; file print ; title; put; put '** the SAS job is now finished'; run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All works fine (no errors, etc) if you run this program interactively - the pdf is generated, the email with the pdf attached is sent ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have been trying to schedule this program to run every morning at 5 AM; we were hoping that Windows Task Scheduler would be the ticket. (by the way, I have Window 8.1 Enterprise)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(if you haven't used windows task, one key feature is you have windows task scheduler run a windows bat file - and this bat file runs the sas program or programs - below are the contents of&amp;nbsp; the bat file I am using to run the above sas program (the sas program is named "sas_gplot_pdf_test_task_scheduler.sas"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"C:\Program Files\SASHome\x86\SASFoundation\9.4\sas.exe" -SYSIN "C:\transfer\sas_gplot_pdf_test_task_scheduler.sas"&amp;nbsp; -LOG "C:\transfer\sas_gplot_pdf_test_task_scheduler.log"&amp;nbsp; -PRINT "C:\transfer\sas_gplot_pdf_test_task_scheduler.lst"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And now here is the PROBLEM (sorry for yelling ;-):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the scheduler fires up, it runs the bat file, which launches sas (see image below):&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;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="task_scheduler_hang.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25810iCA5EB5791EE8848A/image-size/large?v=v2&amp;amp;px=999" role="button" title="task_scheduler_hang.png" alt="task_scheduler_hang.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then just sits there ("hangs") - the log and print file have been generated, but the pdf has not, and no email has been sent.&amp;nbsp; It just sits ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only way I can get things to move forward is to hit the little red "x" for graph window (see image below) - which means this is no longer an automatically scheduled/launched sas program (I don't want to wake up every morning at 5 AM to hit a little red x).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that in interactive sas one can use either dm "graph; end"; or&lt;/P&gt;&lt;P&gt;proc greplay igout = work.gseg nofs;&lt;BR /&gt;delete _all_;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;to clear the Graph 1 Window - but neither seem to work when the sas program is run via Task Scheduler&amp;nbsp; (i.e., when you are not running interactive sas).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="task_scheduler_hang1.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25809i99D1A5A766276FDA/image-size/large?v=v2&amp;amp;px=999" role="button" title="task_scheduler_hang1.png" alt="task_scheduler_hang1.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 20:39:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522687#M4481</guid>
      <dc:creator>canna_guy_scott</dc:creator>
      <dc:date>2018-12-19T20:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using Windows Task Scheduler to run a program with Gplot - hangs!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522717#M4486</link>
      <description>&lt;P&gt;Please post your SAS log file.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 21:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522717#M4486</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-12-19T21:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using Windows Task Scheduler to run a program with Gplot - hangs!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522742#M4492</link>
      <description>&lt;P&gt;Here is the log from the sas job that hangs (when running it using the Windows Task Scheduler).&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 23:06:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522742#M4492</guid>
      <dc:creator>canna_guy_scott</dc:creator>
      <dc:date>2018-12-19T23:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using Windows Task Scheduler to run a program with Gplot - hangs!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522745#M4493</link>
      <description>&lt;P&gt;And here is the log when running the sas program interactively.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 23:09:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522745#M4493</guid>
      <dc:creator>canna_guy_scott</dc:creator>
      <dc:date>2018-12-19T23:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using Windows Task Scheduler to run a program with Gplot - hangs!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522758#M4495</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/251990"&gt;@canna_guy_scott&lt;/a&gt;, I tried your test program and it actually worked (the ODS PDF part) using 9.4M6 on Windows 10 in batch via the task scheduler.&amp;nbsp; I think in some earlier releases you have to close the listing output before the other ods options:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Dec 2018 00:26:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522758#M4495</guid>
      <dc:creator>DaveHorne</dc:creator>
      <dc:date>2018-12-20T00:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using Windows Task Scheduler to run a program with Gplot - hangs!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522796#M4510</link>
      <description>&lt;P&gt;Add the statement &lt;STRONG&gt;ODS _ALL_ close;&lt;/STRONG&gt; before ODS PDF;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 04:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522796#M4510</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-12-20T04:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using Windows Task Scheduler to run a program with Gplot - hangs!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522840#M4523</link>
      <description>&lt;P&gt;Both suggestions work!&amp;nbsp; Thank you so much for solving this mystery!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To recap the succesful suggestions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Suggestion 1:&amp;nbsp; Add the statement &lt;STRONG&gt;ODS listing close;&lt;/STRONG&gt; before ODS PDF;&lt;/P&gt;&lt;P&gt;Suggestion 2:&amp;nbsp; Add the statement &lt;STRONG&gt;ODS _ALL_ close;&lt;/STRONG&gt; before ODS PDF;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 12:40:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-Windows-Task-Scheduler-to-run-a-program-with-Gplot-hangs/m-p/522840#M4523</guid>
      <dc:creator>canna_guy_scott</dc:creator>
      <dc:date>2018-12-20T12:40:56Z</dc:date>
    </item>
  </channel>
</rss>

