<?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: Is there a way to automatically close the window of a stored process when it's done? in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/433064#M5494</link>
    <description>&lt;P&gt;Yup!&amp;nbsp;I have heard of it numerous times, even tried it.&lt;BR /&gt;But this tool requires the sas server and the web server to be on the same domain or server. &lt;BR /&gt;Which is never the case in my setups. &lt;BR /&gt;So I can't use h54s.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Feb 2018 11:30:25 GMT</pubDate>
    <dc:creator>mathias</dc:creator>
    <dc:date>2018-02-01T11:30:25Z</dc:date>
    <item>
      <title>Is there a way to automatically close the window of a stored process when it's done?</title>
      <link>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/390609#M5490</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm execting a STP in a new from my main web page.&lt;/P&gt;
&lt;PRE&gt;&amp;lt;form target="_blank" action="http://&amp;lt;UrlToMySTP&amp;gt;" method="get" enctype="multipart/form-data"&amp;gt;&lt;/PRE&gt;
&lt;P&gt;And I would like it to close automatically when it's done.&lt;/P&gt;
&lt;P&gt;I tried to do this in JavaScript,&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    file _webout;
    put '&amp;lt;HTML&amp;gt;';
    put '   &amp;lt;HEAD&amp;gt;';
    put '   &amp;lt;/HEAD&amp;gt;';
    put '   &amp;lt;BODY onLoad="window.close()"&amp;gt;';
    put '   &amp;lt;/BODY&amp;gt;';
    put '&amp;lt;/HTML&amp;gt;';
    run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but&amp;nbsp;the browsers don't allow that (security vulnerability)&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Scripts may close only the windows that were opened by it.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there another way to close the page?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 14:36:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/390609#M5490</guid>
      <dc:creator>mathias</dc:creator>
      <dc:date>2017-08-24T14:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to automatically close the window of a stored process when it's done?</title>
      <link>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/390887#M5491</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Can you explain why you want to do that or what you're trying to achieve? &amp;nbsp;There may be a different way to get the result that you need.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 12:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/390887#M5491</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2017-08-25T12:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to automatically close the window of a stored process when it's done?</title>
      <link>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/433059#M5492</link>
      <description>&lt;P&gt;When a button is clicked, something needs to be done in SAS, (for example delete a record in a table).&lt;/P&gt;
&lt;P&gt;and that just needs to be done in a separate window&lt;/P&gt;
&lt;P&gt;that window is empty is empty and doesn't need to stay open.&lt;/P&gt;
&lt;P&gt;I wan to avoid the user having to close the empty window manually.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On another case I used a redirect, because I could afford a page refresh, not this time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found a way to just call the STP with ajax. But that was more difficult than I thought necessary.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 10:59:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/433059#M5492</guid>
      <dc:creator>mathias</dc:creator>
      <dc:date>2018-02-01T10:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to automatically close the window of a stored process when it's done?</title>
      <link>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/433060#M5493</link>
      <description>&lt;P&gt;It is MUCH easier, and far better practice, to build web applications on SAS using AJAX and dedicated html / javascript than to try and build your web logic using put statements in a data step!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The process is also far easier given the availability of the Boemska open source h54s &lt;A href="https://github.com/Boemska/h54s" target="_self"&gt;adapter&lt;/A&gt;.&amp;nbsp; I did a &lt;A href="https://www.rawsas.com/2015/12/building-web-apps-with-sas/" target="_self"&gt;post&lt;/A&gt; some time ago explaining how to use the adapter, and an SGF paper &lt;A href="http://support.sas.com/resources/papers/proceedings17/1091-2017.pdf" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The short story - build and deploy your web application logic (html/css/javascript) to the SAS Web Server, and your data step / backend logic (sas programs) to the SAS Application server.&amp;nbsp; This will save a huge amount of trouble as your application complexity increases.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 11:14:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/433060#M5493</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2018-02-01T11:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to automatically close the window of a stored process when it's done?</title>
      <link>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/433064#M5494</link>
      <description>&lt;P&gt;Yup!&amp;nbsp;I have heard of it numerous times, even tried it.&lt;BR /&gt;But this tool requires the sas server and the web server to be on the same domain or server. &lt;BR /&gt;Which is never the case in my setups. &lt;BR /&gt;So I can't use h54s.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 11:30:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/433064#M5494</guid>
      <dc:creator>mathias</dc:creator>
      <dc:date>2018-02-01T11:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to automatically close the window of a stored process when it's done?</title>
      <link>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/433065#M5495</link>
      <description>&lt;P&gt;The tool doesn't require it..&amp;nbsp; Your&amp;nbsp;SAS server&amp;nbsp;is configured to require it.&amp;nbsp; You will have the same issue regardless of whether the adapter is used or not, if building web apps on SAS using ajax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your site does not permit your web files to be served from the SAS Web server, you can always ask for your preferred web server to be whitelisted.&amp;nbsp; &amp;nbsp;And use chrome with CORS disabled in the meantime.&amp;nbsp; This approach is taken by many of our clients.&amp;nbsp; It is far preferable to do these things properly than to have to maintain a web application composed of put statements / proc stream / whatever...&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 11:35:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/433065#M5495</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2018-02-01T11:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to automatically close the window of a stored process when it's done?</title>
      <link>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/433066#M5496</link>
      <description>&lt;P&gt;You don't have CORS issues when using "jsonp", no need to whitelist the webserver on the sasserver.&lt;/P&gt;
&lt;P&gt;(at least I don't, maybe it's different on different setups)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the put statements that write an empty html page are&amp;nbsp;very little in this case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 12:22:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/433066#M5496</guid>
      <dc:creator>mathias</dc:creator>
      <dc:date>2018-02-01T12:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to automatically close the window of a stored process when it's done?</title>
      <link>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/434534#M5497</link>
      <description>&lt;P&gt;Hi Mathias,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The thing with JSONP is that you can't make POST requests, which means you're limited to simple URL-encoded parameter values when sending data to SAS. It's also... a bit of a hack.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not a fan of it, but I'll have a chat to our devs and see if there's a way we can implement it as an optional transport mechanism. Will keep you posted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nik&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 14:04:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Is-there-a-way-to-automatically-close-the-window-of-a-stored/m-p/434534#M5497</guid>
      <dc:creator>boemskats</dc:creator>
      <dc:date>2018-02-06T14:04:28Z</dc:date>
    </item>
  </channel>
</rss>

