<?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: How to quote /* and */ comment characters so that they display and are not hidden in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/627309#M185150</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/46599"&gt;@DougZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes, it works without the macro.&amp;nbsp; But when I try to put that query into a file a %INCLUDE it, Oracle rejects it - doesn't like "%include" as a word I think...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;MPRINT(QUERY_TEST_TEMPLATE):   proc sql noprint;
MPRINT(QUERY_TEST_TEMPLATE):   connect to oracle (path=u01bri_pte user=n550513 password="{SAS002}878424311C65F34222798BEB2159842C" preserve_comments);
MPRINT(QUERY_TEST_TEMPLATE):   execute ( explain plan for %include './test_query_w_hints.txt' ) by oracle;
ERROR: ORACLE execute error: ORA-00911: invalid character.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You need to make the include file have the full EXECUTE command. Not hard to do. Say you have a dataset name CODE with a variable name SQL that has the code to run in the remote database.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename execute temp;
data _null_:
  set code end=eof;
  file execute;
  if _n_=1 then put 'EXECUTE BY ORACLE (';
  put sql ;
  if eof then put ');' ;
run;

proc sql noprint;
connect to oracle (path=u01bri_pte user=n550513 password="{SAS002}878424311C65F34222798BEB2159842C" preserve_comments);
%include execute ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Feb 2020 19:54:06 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-02-25T19:54:06Z</dc:date>
    <item>
      <title>How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626540#M184820</link>
      <description>&lt;P&gt;I use SAS to run Oracle queries with SAS/Access for Oracle.&amp;nbsp; Oracle has things called "hints" which direct the Oracle optimizer to take a different path than what the optimizer would come up with by itself.&amp;nbsp; Here's the problem: Oracle hints rely on /* and */ to identify them.&amp;nbsp; Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select /* + FULL(MH) */ account_num, cycle_date, balance, etc etc&lt;/P&gt;&lt;P&gt;from myschema.mytable&lt;/P&gt;&lt;P&gt;where blah blah&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Oracle code is within a macro for repeatability.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I pass the&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; cursor: text; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;/* + FULL(MH) */&lt;/SPAN&gt; to the Oracle code without it disappearing?&amp;nbsp; I tried %str(/)%str(*) + FULL(MH) %str(*)%str(/) but that doesn't work...&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 19:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626540#M184820</guid>
      <dc:creator>DougZ</dc:creator>
      <dc:date>2020-02-21T19:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626551#M184824</link>
      <description>&lt;P&gt;I think this covers what you are looking for.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=p1uutrqh4za0sgn1c26jj7z1k6m9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=p1uutrqh4za0sgn1c26jj7z1k6m9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 20:15:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626551#M184824</guid>
      <dc:creator>Krueger</dc:creator>
      <dc:date>2020-02-21T20:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626563#M184831</link>
      <description>&lt;P&gt;Are you letting SAS generate the Oracle code?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mylib oracle ... schema=myschema &lt;SPAN&gt;preserve_comments&lt;/SPAN&gt;;
proc sql;
select /* + FULL(MH) */ account_num, cycle_date, balance
from mylib.mytable
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or are you passing the code explicitly to Oracle?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mylib oracle .... &lt;SPAN&gt;preserve_comments&lt;/SPAN&gt; ;
proc sql;
connect using mylib;
select * from connection to mylib
(
select /* + FULL(MH) */ account_num, cycle_date, balance
from myschema.mytable
)
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the code is in a macro then you need to add some macro quoting to prevent the macro processor from throwing away the comments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(
select /%str(*) + FULL(MH) %str(*)/ account_num, cycle_date, balance
from myschema.mytable
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Feb 2020 21:11:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626563#M184831</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-21T21:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626564#M184832</link>
      <description>&lt;P&gt;Nice feature but sadly it doesn't seem to work within a Proc SQL select statement.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 21:17:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626564#M184832</guid>
      <dc:creator>DougZ</dc:creator>
      <dc:date>2020-02-21T21:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626567#M184834</link>
      <description>&lt;P&gt;Good questions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm passing the query, including any Oracle hints, as a macro variable string.&amp;nbsp; That way I can re-use the code with many different problem queries that users send my way.&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT face="courier new,courier"&gt;***********************************************************;&lt;BR /&gt;* DECLARE THE QUERY HERE ;&lt;BR /&gt;************************************************************;&lt;BR /&gt;%let the_query=&lt;BR /&gt;select @%str(*) + FULL(MHR) %str(*)@@&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %bquote('&amp;amp;query_name_revision') as query_name, spm_loan_key, asset_date, balance, port_type&lt;BR /&gt;from is2.mortgage_history&lt;BR /&gt;where asset_date &amp;gt;= '31dec2019'&lt;BR /&gt;;&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;(note: I changed the slashes above to&amp;nbsp;@ to escape the Communities&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #cc0000; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt; invalid HTML&amp;nbsp;&lt;/SPAN&gt; message when I hit Post).&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;… then:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    ******************************************************;
    * Extract data from the ORACLE table (code SQL below) ;
    ******************************************************;
    proc sql;
        ******************************************************;
        * Establish ORACLE connectivity via SAS/Access-Oracle ;
        ******************************************************;
        connect to oracle (path=&amp;amp;ORACLE_OID_STRING  user=&amp;amp;ORACLE_USER  password="&amp;amp;ORAPASS" preserve_comments);
        ******************************************************;
        * Run the query ;
        ******************************************************;
        create table &amp;amp;out  as
        select * from connection to oracle
        (
         &amp;amp;the_query
           );
    quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;FONT&gt;Here is the resolved macro in the log after it ran (it ignored the hints again)&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;create table OUTLIB.u01bri_IS2_hints_pl1394_data as select * from connection to oracle ( select 'hints_1394' as query_name, spm_loan_key,
asset_date, balance, port_type from is2.mortgage_history where asset_date &amp;gt;= '31dec2019' );
NOTE: Table OUTLIB.U01BRI_IS2_HINTS_PL1394_DATA created, with 19391212 rows and 5 columns.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 21:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626567#M184834</guid>
      <dc:creator>DougZ</dc:creator>
      <dc:date>2020-02-21T21:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626574#M184835</link>
      <description>&lt;P&gt;I committed a typo in my code above.&amp;nbsp; It was as I tried to replace the slashes with "@"s to escape the invalid HTML checker on this site.&amp;nbsp; I added one too many of these "@"s.&amp;nbsp; Should be:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: courier new,courier; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;select %str(*) + FULL(MHR) %str(*)/&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 22:36:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626574#M184835</guid>
      <dc:creator>DougZ</dc:creator>
      <dc:date>2020-02-21T22:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626575#M184836</link>
      <description>&lt;P&gt;OK, still trying to work through this... thought I'd try the actual slashes again but that didn't work.&amp;nbsp; Do the&amp;nbsp;@-to-slash in your head here&amp;nbsp; : )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: courier new,courier; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;select @%str(*) + FULL(MHR) %str(*)@@&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 22:37:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626575#M184836</guid>
      <dc:creator>DougZ</dc:creator>
      <dc:date>2020-02-21T22:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626579#M184837</link>
      <description>&lt;P&gt;OK, weird... I'm pretty sure I put just one "@" there at the end.&amp;nbsp; I'll try again, this time with "S" instead of forward-slash&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;select S%str(*) + FULL(MHR) %str(*)S&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 23:00:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626579#M184837</guid>
      <dc:creator>DougZ</dc:creator>
      <dc:date>2020-02-21T23:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626589#M184839</link>
      <description>&lt;P&gt;Does your program work correctly if you hard code your SQL with the hint included and not define it in a macro variable?&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 02:17:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626589#M184839</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-02-22T02:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626590#M184840</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/46599"&gt;@DougZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I committed a typo in my code above.&amp;nbsp; It was as I tried to replace the slashes with "@"s to escape the invalid HTML checker on this site.&amp;nbsp; I added one too many of these "@"s.&amp;nbsp; Should be:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; font-family: courier new,courier; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;select %str(*) + FULL(MHR) %str(*)/&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;How are you pasting in the text of your code that you are getting HTML errors?&lt;/P&gt;
&lt;P&gt;Just click on the Insert Code or Insert SAS Code button and paste the text into the pop-up window.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 02:31:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626590#M184840</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-22T02:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626591#M184841</link>
      <description>&lt;P&gt;First question is does it work without the macro (or the macro variables)?&amp;nbsp; Just run the PROC SQL step directly.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
connect to oracle (path=&amp;amp;ORACLE_OID_STRING  user=&amp;amp;ORACLE_USER  password="&amp;amp;ORAPASS" preserve_comments);
create table &amp;amp;out  as
select * from connection to oracle
(select /* + FULL(MHR) */
 'XXXX' as query_name, spm_loan_key, asset_date, balance, port_type
 from is2.mortgage_history
 where asset_date &amp;gt;= '31dec2019'
);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If that works then what happens when you put it in a file a %INCLUDE it?&lt;/P&gt;
&lt;P&gt;If that works what happens if you wrap that code that has the %include into a macro definition and then execute the macro?&lt;/P&gt;
&lt;P&gt;If that works then instead of macro this macro that just generate the code you want to run to a file and %include it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 02:38:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626591#M184841</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-22T02:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626599#M184846</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/46599"&gt;@DougZ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;preserve_comments works and I've used it in the past.&lt;/P&gt;
&lt;P&gt;May be first execute some test SQL where everything including the hints is hard-coded and make this work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When passing in the syntax via a SAS macro variable where you've used %str() and other quoting functions to create the string then eventually use %unquote(&amp;amp;macvar).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 04:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/626599#M184846</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-02-22T04:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/627305#M185148</link>
      <description>Yes, that does work, but it defeats the purpose of having a re-usable program that can run any given query.</description>
      <pubDate>Tue, 25 Feb 2020 19:47:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/627305#M185148</guid>
      <dc:creator>DougZ</dc:creator>
      <dc:date>2020-02-25T19:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/627307#M185149</link>
      <description>&lt;P&gt;Yes, it works without the macro.&amp;nbsp; But when I try to put that query into a file a %INCLUDE it, Oracle rejects it - doesn't like "%include" as a word I think...&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;MPRINT(QUERY_TEST_TEMPLATE):   proc sql noprint;
MPRINT(QUERY_TEST_TEMPLATE):   connect to oracle (path=u01bri_pte user=n550513 password="{SAS002}878424311C65F34222798BEB2159842C" preserve_comments);
MPRINT(QUERY_TEST_TEMPLATE):   execute ( explain plan for %include './test_query_w_hints.txt' ) by oracle;
ERROR: ORACLE execute error: ORA-00911: invalid character.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Feb 2020 19:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/627307#M185149</guid>
      <dc:creator>DougZ</dc:creator>
      <dc:date>2020-02-25T19:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to quote /* and */ comment characters so that they display and are not hidden</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/627309#M185150</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/46599"&gt;@DougZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes, it works without the macro.&amp;nbsp; But when I try to put that query into a file a %INCLUDE it, Oracle rejects it - doesn't like "%include" as a word I think...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;MPRINT(QUERY_TEST_TEMPLATE):   proc sql noprint;
MPRINT(QUERY_TEST_TEMPLATE):   connect to oracle (path=u01bri_pte user=n550513 password="{SAS002}878424311C65F34222798BEB2159842C" preserve_comments);
MPRINT(QUERY_TEST_TEMPLATE):   execute ( explain plan for %include './test_query_w_hints.txt' ) by oracle;
ERROR: ORACLE execute error: ORA-00911: invalid character.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You need to make the include file have the full EXECUTE command. Not hard to do. Say you have a dataset name CODE with a variable name SQL that has the code to run in the remote database.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename execute temp;
data _null_:
  set code end=eof;
  file execute;
  if _n_=1 then put 'EXECUTE BY ORACLE (';
  put sql ;
  if eof then put ');' ;
run;

proc sql noprint;
connect to oracle (path=u01bri_pte user=n550513 password="{SAS002}878424311C65F34222798BEB2159842C" preserve_comments);
%include execute ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 19:54:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-quote-and-comment-characters-so-that-they-display-and-are/m-p/627309#M185150</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-25T19:54:06Z</dc:date>
    </item>
  </channel>
</rss>

