<?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: Passing sas character variables into oracle query in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200941#M4426</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. It is working after adding this-&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(%unquote(%str(%'&amp;amp;child%'))) &lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;in where statement. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Mar 2015 20:25:24 GMT</pubDate>
    <dc:creator>archana</dc:creator>
    <dc:date>2015-03-13T20:25:24Z</dc:date>
    <item>
      <title>Passing sas character variables into oracle query</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200934#M4419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I am trying the below but it is not working.&amp;nbsp; I am not getting any data. please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;data child_id;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;infile "$inbound_path/program_child_id.txt" dlm=",";&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;input id :$11. @@;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;select * into :child separated by ','&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;from child_id;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;create table x as select * from connection to oracle&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(select a.*, b.*&amp;nbsp;&amp;nbsp; from table1 a,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b&lt;/P&gt;&lt;P&gt;where a.program_id in (&amp;amp;program)&lt;/P&gt;&lt;P&gt;and trim(a.program_child_id) in ('&amp;amp;child')&lt;BR /&gt;and a.program_id&amp;nbsp; = b.program_id&lt;BR /&gt;and a.program_child_id&amp;nbsp; = b.program_child_id&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 13:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200934#M4419</guid>
      <dc:creator>archana</dc:creator>
      <dc:date>2015-03-13T13:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Passing sas character variables into oracle query</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200935#M4420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Macro variables need to be enclosed within double quotes.&amp;nbsp; So your statement;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;select * into :child separated by '","'&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;&lt;SPAN lang="EN" style="font-weight: inherit; font-style: inherit; font-size: 10.6666679382324px; font-family: inherit;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Note the single then double quotes and doubel then single.&amp;nbsp; Then in your program:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;and trim(a.program_child_id) in ("&amp;amp;child")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;Thus it resolves to: in ("abc","def","efg").&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;Same for program:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 13px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;where a.program_id in ("&amp;amp;program")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 13px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 13px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;So your code needs to resolve to SQL compliant results.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 14:14:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200935#M4420</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-03-13T14:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Passing sas character variables into oracle query</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200936#M4421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also note, this is a duplicate of this thread: &lt;A __default_attr="261857" __jive_macro_name="message" class="jive_macro jive_macro_message" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 14:18:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200936#M4421</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-03-13T14:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Passing sas character variables into oracle query</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200937#M4422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;where findw("&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;amp;program",strip(&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;a.program),','&lt;/SPAN&gt;&lt;/SPAN&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 14:39:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200937#M4422</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-03-13T14:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Passing sas character variables into oracle query</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200938#M4423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;This didnt work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 16:42:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200938#M4423</guid>
      <dc:creator>archana</dc:creator>
      <dc:date>2015-03-13T16:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: Passing sas character variables into oracle query</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200939#M4424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, you will have to be more specific, what didn't work, what errors/warnings etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 17:20:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200939#M4424</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-03-13T17:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Passing sas character variables into oracle query</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200940#M4425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually it failed.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ERROR: ORACLE prepare error: ORA-00904: "&amp;amp;child": invalid identifier. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 18:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200940#M4425</guid>
      <dc:creator>archana</dc:creator>
      <dc:date>2015-03-13T18:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Passing sas character variables into oracle query</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200941#M4426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. It is working after adding this-&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(%unquote(%str(%'&amp;amp;child%'))) &lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;in where statement. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 20:25:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Passing-sas-character-variables-into-oracle-query/m-p/200941#M4426</guid>
      <dc:creator>archana</dc:creator>
      <dc:date>2015-03-13T20:25:24Z</dc:date>
    </item>
  </channel>
</rss>

