title: Sas STP Putting javascript, Problems with jquery interpretation
body: <p>I have some stored processes in which put out some html and javascript, when i call them in browser (stored process web portal, Sas 9.3) they work:</p>
  
  <p>Working example:</p>
  
  <pre><code>put '&lt;script type="text/javascript"&gt;';
  if _n_ = 1  then do;
  put 'function spSDesc(index){';
  put 'document.getElementById("descText").value=spDescs[index];';
  /*or put "document.getElementById(%str(%"descText%")).value=spDescs[index];";*/
  put '};';
  put '&lt;/script&gt;';
  </code></pre>
  
  <p>this works fine.</p>
  
  <p>But now i want to do some jquery code, but it does not work that way:</p>
  
  <pre><code>put  " &lt;script src=%STR(%"https://code.jquery.com/jquery-1.12.4.js%")&gt;&lt;/script&gt;";
  put "  &lt;script src=%STR(%"https://code.jquery.com/ui/1.12.0/jquery-ui.js%")&gt;&lt;/script&gt;";
  put "&lt;script&gt;";
  put " $( function() {";
  put " $(%str(%"#datepicker%")).datepicker();";
  /* or put ' $("#datepicker").datepicker();';*/
  put "  } );";
  put "&lt;/script&gt;";
  </code></pre>
  
  <p>gives me an error in browser:</p>
  
  <p>mozilla firefox:</p>
  
  <blockquote>
    <p>15:19:47.465 SyntaxError: expected expression, got '&amp;'1 do:1400:3</p>
  </blockquote>
  
  <p>IE</p>
  
  <blockquote>
    <p>SCRIPT1002: Syntaxfehler Datei: do, Zeile: 1400, Spalte: 5</p>
  </blockquote>
  
  <p>Code in browser:</p>
  
  <pre><code>&lt;script src="https://code.jquery.com/jquery-1.12.4.js"&gt;&lt;/script&gt;                                                                                                                                  
  &lt;script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"&gt;&lt;/script&gt;                                                                                                                          
  &lt;script&gt;                                                                                                                                                                                          
   $( function() {                                                                                                                                                                                  
   $(&amp;quot;#datepicker&amp;quot;).datepicker();                                                                                                                                                                    
    } );                                                                                                                                                                                            
  &lt;/script&gt; 
  </code></pre>
  
  <p>So the <code>"</code> is not handled correct, if i use it in some jquery depended code (see that it worked correct for the script src= part). </p>
  
  <p>Can somebody help me handle this problem? Do i need to escape the <code>"</code> in another way, or use other jquery code? Or does it not work with jquery at all?</p>
  
  <p>EDIT:
  As far as i understand the problem is:
  The <code>&amp;quot;</code> is not interpreted as <code>"</code>, so i get an syntaxerror
  So i need the stp to write a <code>"</code>´ instead of <code>&amp;quot;</code> or get jquery/javascript/browser to interpret <code>&amp;quot;</code> as <code>"</code> inside the function.</p>
  
  <p><strong>EDIT2 + Solution:</strong>
  On my working environment i only work with file _webout (and my workingexample is from there), i thought in my testenvironment i could use file print as equivalent, but i was wrong. I had not included my complete output  code in my example, so this was not solveable, i am sorry for that.</p>
  
  <pre><code>data _null_;
  
  *file print; /*does not work correct with "*/
  
  file _webout;/*does work correct with "*/
  
  put ...... /*example code comes here*/
  
  
  run;
  </code></pre>