<?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: Put single quotes in variable values in a string in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Put-single-quotes-in-variable-values-in-a-string/m-p/617150#M19023</link>
    <description>&lt;P&gt;So you want &lt;EM&gt;users&lt;/EM&gt; to put in text that is later used in &lt;EM&gt;code&lt;/EM&gt;? Ever heard of "code injection"? I don't want to be in your shoes when you have to explain to the auditors why the data warehouse needs to be rebuilt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS see&amp;nbsp;&lt;A href="https://xkcd.com/327/" target="_blank" rel="noopener"&gt;https://xkcd.com/327/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jan 2020 08:02:34 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-01-14T08:02:34Z</dc:date>
    <item>
      <title>Put single quotes in variable values in a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Put-single-quotes-in-variable-values-in-a-string/m-p/617148#M19022</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For a sas/af application where the user can put free text related to variable values in a dataset, in order to make a sub-query in a WHERE statement, such as:&lt;/P&gt;&lt;P&gt;SEX=1 AND AGE&amp;gt;=16&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to put quotes in the alphanumeric variable values and leave the numeric ones as they are. Lets say SEX is alphanumeric and AGE numeric, so the result should be:&lt;/P&gt;&lt;P&gt;SEX='1' AND AGE&amp;gt;=16&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course there is a list of alphanumeric and numeric variables and all operators could be used ( = EQ,^= NE,¬= NE,~= NE,&amp;gt; GT,&amp;lt; LT,&amp;gt;= GE,&amp;lt;= LE, IN,&amp;amp; AND,| OR,! OR,¦ OR,¬ NOT,ˆ NOT,~ NOT).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 07:42:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Put-single-quotes-in-variable-values-in-a-string/m-p/617148#M19022</guid>
      <dc:creator>Incubu</dc:creator>
      <dc:date>2020-01-14T07:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Put single quotes in variable values in a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Put-single-quotes-in-variable-values-in-a-string/m-p/617150#M19023</link>
      <description>&lt;P&gt;So you want &lt;EM&gt;users&lt;/EM&gt; to put in text that is later used in &lt;EM&gt;code&lt;/EM&gt;? Ever heard of "code injection"? I don't want to be in your shoes when you have to explain to the auditors why the data warehouse needs to be rebuilt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS see&amp;nbsp;&lt;A href="https://xkcd.com/327/" target="_blank" rel="noopener"&gt;https://xkcd.com/327/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 08:02:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Put-single-quotes-in-variable-values-in-a-string/m-p/617150#M19023</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-14T08:02:34Z</dc:date>
    </item>
    <item>
      <title>Put single quotes in variable values in a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Put-single-quotes-in-variable-values-in-a-string/m-p/617400#M19071</link>
      <description>Thanks for the reply!&lt;BR /&gt;This application is restricted for internal users and code is audited before inserted in the query. Only code as described admited.&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Jan 2020 10:53:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Put-single-quotes-in-variable-values-in-a-string/m-p/617400#M19071</guid>
      <dc:creator>Incubu</dc:creator>
      <dc:date>2020-01-15T10:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Put single quotes in variable values in a string</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Put-single-quotes-in-variable-values-in-a-string/m-p/617402#M19072</link>
      <description>&lt;P&gt;If you audit the code anyway (which is a tedious process), you don't need that fancy stuff. Have users send you the code per email and run it. And if they are able to write that code, have them run it with their own account, which you can restrict appropriately so they don't cause havoc.&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;</description>
      <pubDate>Wed, 15 Jan 2020 11:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Put-single-quotes-in-variable-values-in-a-string/m-p/617402#M19072</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-15T11:06:56Z</dc:date>
    </item>
  </channel>
</rss>

