<?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: Setting value for a variable inside javascript in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Setting-value-for-a-variable-inside-javascript/m-p/200037#M37387</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Specify the variable that the second procedure wants on the html form that is generating the URL to call it.&lt;/P&gt;&lt;P&gt;You could make it hidden (like the _PROGRAM variable) or not depending on how you want your form to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Apr 2015 15:45:40 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2015-04-20T15:45:40Z</dc:date>
    <item>
      <title>Setting value for a variable inside javascript</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-value-for-a-variable-inside-javascript/m-p/200036#M37386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have been writing a report in SAS using HTML frontend.&lt;/P&gt;&lt;P&gt;1) I am calling a Stored procedure from another stored procedure and basically want the value of a variable defined in the first STP to be available in the called STP.&lt;/P&gt;&lt;P&gt;I tried declaring the variable as GLOBAL but I am unable to get the value to the second STP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) How to set the value of a macro variable inside javascript. when I try to do so, it throws javascript error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%global case;&lt;BR /&gt;%let case=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null;&lt;BR /&gt;file _webout;&lt;BR /&gt;input;&lt;BR /&gt;line=resolve(_infile_);&lt;BR /&gt;put line;&lt;BR /&gt;cards4;&lt;/P&gt;&lt;P&gt;&amp;lt;html&amp;gt;&lt;BR /&gt; &amp;lt;head&amp;gt;&amp;lt;script&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function getvalues()&lt;BR /&gt;{&lt;BR /&gt;var case=2&lt;BR /&gt;alert("&amp;amp;case");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; function performAction(actionType)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(actionType.value=="GENERATE")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var adsbmt=window.confirm("Please Wait while the System Searches for Confirmed Details!!");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (adsbmt)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {document.getElementById("_PROGRAM").value="/test/Training/php_test";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.ADD_SHARE.submit();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/script&amp;gt;&amp;lt;/head&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;body onload="getvalues()"&amp;gt;&amp;lt;h1 align="center" &amp;gt;Report&amp;lt;/h1&amp;gt;&amp;nbsp; &lt;BR /&gt;&amp;lt;form name="ADD_SHARE" method="POST" action="&lt;A href="http://****/SASStoredProcess/do"&gt;http://****/SASStoredProcess/do&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;INPUT TYPE="HIDDEN" NAME="_PROGRAM" ID="_PROGRAM"&amp;nbsp; VALUE=""&amp;gt;&lt;BR /&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;table&amp;gt;&lt;BR /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; Enter NAME&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;BR /&gt;&amp;lt;input type="text" name="name"&amp;gt;&amp;lt;BR&amp;gt; &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;lt;tr&amp;gt;&amp;lt;/tr&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;table&amp;gt;&lt;BR /&gt;&amp;lt;/table&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;font size="1" face="Verdana"&amp;gt;&amp;lt;CENTER&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type="button" value="GENERATE" name="btn_update" id="GENERATE" onclick="performAction(this)" style="font-family: Verdana; font-size: 10pt; font-weight: 700"&amp;gt;&amp;lt;/font&amp;gt;';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/table&amp;gt;&lt;BR /&gt;&amp;lt;/form&amp;gt; &lt;BR /&gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;nbsp; &lt;BR /&gt;;;;;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 15:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-value-for-a-variable-inside-javascript/m-p/200036#M37386</guid>
      <dc:creator>Anand6666</dc:creator>
      <dc:date>2015-04-20T15:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Setting value for a variable inside javascript</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-value-for-a-variable-inside-javascript/m-p/200037#M37387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Specify the variable that the second procedure wants on the html form that is generating the URL to call it.&lt;/P&gt;&lt;P&gt;You could make it hidden (like the _PROGRAM variable) or not depending on how you want your form to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 15:45:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-value-for-a-variable-inside-javascript/m-p/200037#M37387</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-04-20T15:45:40Z</dc:date>
    </item>
  </channel>
</rss>

