<?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: datatyp on storedprocess in Developers</title>
    <link>https://communities.sas.com/t5/Developers/datatyp-on-storedprocess/m-p/12835#M2324</link>
    <description>%bquote()  does not quote &amp;amp; and %, while the implicit %eval() (between '%if' and '%then') considers &amp;amp; as a logical AND operator. That is, the %bquote() is an inadequate choice of macro quoting function in this case. Assign "SAS R&amp;amp;D" to nVal and run the macro %test and see what happens! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I would rather suggest %superq(). &lt;BR /&gt;
&lt;BR /&gt;
See if reading this paper helps a bit: &lt;A href="http://changchung.com/download/022-2009.pdf" target="_blank"&gt;http://changchung.com/download/022-2009.pdf&lt;/A&gt;</description>
    <pubDate>Wed, 20 Oct 2010 15:08:12 GMT</pubDate>
    <dc:creator>chang_y_chung_hotmail_com</dc:creator>
    <dc:date>2010-10-20T15:08:12Z</dc:date>
    <item>
      <title>datatyp on storedprocess</title>
      <link>https://communities.sas.com/t5/Developers/datatyp-on-storedprocess/m-p/12831#M2320</link>
      <description>hi experts,&lt;BR /&gt;
&lt;BR /&gt;
i have this piece of code on my stored process, validating input from a form. Alphanumeric should only be the valid values for the variable, else i'll be displaying an error on the output.&lt;BR /&gt;
&lt;BR /&gt;
%if %datatyp(&amp;amp;nVal) ne NUMERIC and &amp;amp;nVal ne %str() %then %do;&lt;BR /&gt;
	%let invThreshold = 1;&lt;BR /&gt;
	%let isClean = 1;&lt;BR /&gt;
%end;&lt;BR /&gt;
&lt;BR /&gt;
problem I'm having problems validating special characters. when the value of the macro variable nVal is either of the ff:&lt;BR /&gt;
&lt;BR /&gt;
!@#$%&amp;amp;_=[]\&amp;lt;&amp;gt;`;:?&lt;BR /&gt;
&lt;BR /&gt;
the stored process will correctly display the result. indicating an error message. however when the value of the macro variable is either of the ff:&lt;BR /&gt;
&lt;BR /&gt;
*+-()/~^|&lt;BR /&gt;
&lt;BR /&gt;
the stored process will result into an error. I noticed that these characters are used for equations(addition,subtraction,etc.)&lt;BR /&gt;
&lt;BR /&gt;
What's the proper way to mask nVal so whenever the the input values is either of the following i'll be able to handle them properly?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance,&lt;BR /&gt;
Milton</description>
      <pubDate>Wed, 06 Oct 2010 13:06:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/datatyp-on-storedprocess/m-p/12831#M2320</guid>
      <dc:creator>milts</dc:creator>
      <dc:date>2010-10-06T13:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: datatyp on storedprocess</title>
      <link>https://communities.sas.com/t5/Developers/datatyp-on-storedprocess/m-p/12832#M2321</link>
      <description>Try:&lt;BR /&gt;
[pre]&lt;BR /&gt;
%if (%datatyp(%bquote(&amp;amp;nVal)) ne NUMERIC) and (&amp;amp;nVal ne ) %then %do;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Vince DelGobbo&lt;BR /&gt;
SAS R&amp;amp;D</description>
      <pubDate>Wed, 06 Oct 2010 21:37:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/datatyp-on-storedprocess/m-p/12832#M2321</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2010-10-06T21:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: datatyp on storedprocess</title>
      <link>https://communities.sas.com/t5/Developers/datatyp-on-storedprocess/m-p/12833#M2322</link>
      <description>Hi Vince,&lt;BR /&gt;
&lt;BR /&gt;
Still no go when it comes to characters used for equations. You can test it with this piece of code, just replace the value on symput.&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
	call symput('nVal','-');&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
%macro test;&lt;BR /&gt;
	%if (%datatyp(%bquote(&amp;amp;nVal)) ne NUMERIC ) and (&amp;amp;nVal ne ) %then %do;&lt;BR /&gt;
		%put if clause;&lt;BR /&gt;
	%end;&lt;BR /&gt;
	%else %do;&lt;BR /&gt;
		%put else clause;&lt;BR /&gt;
	%end;&lt;BR /&gt;
%mend;&lt;BR /&gt;
%test&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Milton</description>
      <pubDate>Thu, 07 Oct 2010 00:58:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/datatyp-on-storedprocess/m-p/12833#M2322</guid>
      <dc:creator>milts</dc:creator>
      <dc:date>2010-10-07T00:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: datatyp on storedprocess</title>
      <link>https://communities.sas.com/t5/Developers/datatyp-on-storedprocess/m-p/12834#M2323</link>
      <description>Try using BQUOTE on the other reference to NVAL, too.&lt;BR /&gt;
&lt;BR /&gt;
Vince DelGobbo&lt;BR /&gt;
SAS R&amp;amp;D</description>
      <pubDate>Thu, 07 Oct 2010 01:07:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/datatyp-on-storedprocess/m-p/12834#M2323</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2010-10-07T01:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: datatyp on storedprocess</title>
      <link>https://communities.sas.com/t5/Developers/datatyp-on-storedprocess/m-p/12835#M2324</link>
      <description>%bquote()  does not quote &amp;amp; and %, while the implicit %eval() (between '%if' and '%then') considers &amp;amp; as a logical AND operator. That is, the %bquote() is an inadequate choice of macro quoting function in this case. Assign "SAS R&amp;amp;D" to nVal and run the macro %test and see what happens! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I would rather suggest %superq(). &lt;BR /&gt;
&lt;BR /&gt;
See if reading this paper helps a bit: &lt;A href="http://changchung.com/download/022-2009.pdf" target="_blank"&gt;http://changchung.com/download/022-2009.pdf&lt;/A&gt;</description>
      <pubDate>Wed, 20 Oct 2010 15:08:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/datatyp-on-storedprocess/m-p/12835#M2324</guid>
      <dc:creator>chang_y_chung_hotmail_com</dc:creator>
      <dc:date>2010-10-20T15:08:12Z</dc:date>
    </item>
  </channel>
</rss>

