<?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: difficulty developing in proc sql: commenting comments in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/537153#M74003</link>
    <description>&lt;P&gt;This seems the best solution of those in this discussion for my purposes. The code does not get colored or highlighted as a comment (any way to change?), but the code will run fine with the inline macro comment, and chunks of code with inline macro comments can be commented out with &amp;lt;CTRL + /&amp;gt;, which really facilitates development, IMO. Happy to hear dissenting opinions, though.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Feb 2019 18:45:50 GMT</pubDate>
    <dc:creator>tfarkas</dc:creator>
    <dc:date>2019-02-20T18:45:50Z</dc:date>
    <item>
      <title>difficulty developing in proc sql: commenting comments</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/535891#M73937</link>
      <description>&lt;P&gt;UPDATED:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Within a PROC SQL step, I comment code using &amp;lt;/* comment */&amp;gt;, like this;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;

create table comment_test as 

select *
from sashelp.cars
where make = 'Acura' /*filter by make*/&lt;BR /&gt;&lt;BR /&gt;order by model; 
;
quit; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;During development, however, I may want to comment out large sections of code, like the where statement in the above snippet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;

create table comment_test as 

select *
from sashelp.cars
/*where make = 'Acura' /*filter by make*/*/&lt;BR /&gt;order by model; 
;
quit; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, you'll notice that the right-hand, closing comment characters are now executable, so the step fails.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A similar problem comes up if developing with, say, the data step.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data comment_test;&lt;BR /&gt;
    set sashelp.cars;
/*	where make = 'Acura'; /* filter by make */*/&lt;BR /&gt;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here, everything after the comment characters is commented out, so the run statement will not execute and the program fails.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution in the data step is to use &amp;lt;* comment ;&amp;gt; statements, rather than &amp;lt;/* comment */&amp;gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data comment_test;

    set sashelp.cars;
/*	where make = 'Acura'; * filter by make; */

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this style of commenting is not available in proc sql. Try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;

create table comment_test as 

select *
from sashelp.cars
where make = 'Acura'  *filter by make;
order by model;

;

quit; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can somebody please advise on a development workflow in proc sql that accommodates this issue?&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>Fri, 15 Feb 2019 19:02:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/535891#M73937</guid>
      <dc:creator>tfarkas</dc:creator>
      <dc:date>2019-02-15T19:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: difficulty developing in proc sql: commenting comments</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/535945#M73945</link>
      <description>&lt;P&gt;The simplest trick is to define the blocked-out section of code as a macro:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table comment_test as
select * from sashelp.cars
%macro skip;
where make = 'Acura'; /* filter by make */
%mend skip;
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since the semicolon is part of the skipped code, you need to add one at the bottom of the SELECT statement in this particular case.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 18:00:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/535945#M73945</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-02-15T18:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: difficulty developing in proc sql: commenting comments</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/535949#M73947</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/238489"&gt;@tfarkas&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Within a PROC SQL step, I comment code using &amp;lt;/* comment */&amp;gt;, like this;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;

create table comment_test as 

select *
from sashelp.cars
where make = 'Acura'; /*filter by make*/

quit; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;During development, however, I may want to comment out large sections of code, like the where statement in the above snippet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;

create table comment_test as 

select *
from sashelp.cars
/* where make = 'Acura'; /*filter by make*/ */

quit; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, you'll notice that the right-hand, closing comment characters are now executable, so the step fails.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A similar problem comes up if developing with, say, the data step.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data comment_test;&lt;BR /&gt;
    set sashelp.cars;
/*	where make = 'Acura'; /* filter by make */*/&lt;BR /&gt;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here, everything after the comment characters is commented out, so the run statement will not execute and the program fails.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution in the data step is to use &amp;lt;* comment ;&amp;gt; statements, rather than &amp;lt;/* comment */&amp;gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data comment_test;

    set sashelp.cars;
/*	where make = 'Acura'; * filter by make; */

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But this style of commenting is not available in proc sql.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can somebody please advise on a development workflow in proc sql that accommodates this issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I "solve" this problem by not placing inline comments, always on a separate line and paying attention when block commenting code.&lt;/P&gt;
&lt;P&gt;I also don't use the * text; comment.&lt;/P&gt;
&lt;P&gt;This code runs fine on my system.&lt;/P&gt;
&lt;PRE&gt;proc sql;
create table work.comment_test as 
select *
from sashelp.cars
/*where make = 'Acura';  *filter by make; */
 &lt;FONT color="#ff0000"&gt;;&lt;/FONT&gt;
quit;&lt;/PRE&gt;
&lt;P&gt;I suspect the issue that made you think it wasn't available was that you included the semicolon that ends the create tableinside the commented text. So the quit wasn't properly recognized and left Proc SQL running.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 18:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/535949#M73947</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-02-15T18:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: difficulty developing in proc sql: commenting comments</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/535954#M73948</link>
      <description>&lt;P&gt;In addition to the above, if you are needing to do this within a macro, you could use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if 0 %then %do;
    ... code to comment out ...
%end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Feb 2019 18:16:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/535954#M73948</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-15T18:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: difficulty developing in proc sql: commenting comments</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/535963#M73949</link>
      <description>&lt;P&gt;Yes, I've omitted a semi-colon! However, see my updated question. &amp;lt;* comment ;&amp;gt; does not work inside the select statement, so I'm left with the same problem. Am I still missing something?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 18:59:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/535963#M73949</guid>
      <dc:creator>tfarkas</dc:creator>
      <dc:date>2019-02-15T18:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: difficulty developing in proc sql: commenting comments</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/536023#M73950</link>
      <description>&lt;P&gt;I already gave you one working solution.&amp;nbsp; Macro language is the better way.&amp;nbsp; But if you must have another solution that uses no macro language, omit the extra */ in this fashion:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table comment_test as
select * from sashelp.cars
/* where make='Acura'; /* filter by make */
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;The second /* becomes part of the comment.&amp;nbsp; The first /* begins the comment, and the final */ ends the comment.&amp;nbsp; It works, but it is less flexible since there could be many sets of embedded comments within the section of code that you want to skip.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The semicolon is needed, since the original semicolon is part of the comment.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 20:07:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/536023#M73950</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-02-15T20:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: difficulty developing in proc sql: commenting comments</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/536063#M73951</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/238489"&gt;@tfarkas&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes, I've omitted a semi-colon! However, see my updated question. &amp;lt;* comment ;&amp;gt; does not work inside the select statement, so I'm left with the same problem. Am I still missing something?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't know. Perhaps you are using EG or a SAS Studio version of some sort. Running in SAS Display Manager (or Foundation or Base)&lt;/P&gt;
&lt;PRE&gt;186  proc sql;
187  create table work.comment_test as
188  select *
189  from sashelp.cars
190  /*where make = 'Acura';  *filter by make; */
191   ;
NOTE: Table WORK.COMMENT_TEST created, with 428 rows and 15 columns.

192  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.05 seconds
      cpu time            0.01 seconds


&lt;/PRE&gt;
&lt;P&gt;runs just fine with the line comment you are having problems with (after adding the ; to end the Create table.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 21:22:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/536063#M73951</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-02-15T21:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: difficulty developing in proc sql: commenting comments</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/536068#M73952</link>
      <description>&lt;P&gt;Your code shows the comment &lt;EM&gt;after&lt;/EM&gt; the SELECT statement is closed, which works fine for me too (I am using EG). If you try to comment the FROM statement, for example, the &amp;lt;* comment ;&amp;gt; syntax doesn't work, I don't think. Does it work for you?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 21:28:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/536068#M73952</guid>
      <dc:creator>tfarkas</dc:creator>
      <dc:date>2019-02-15T21:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: difficulty developing in proc sql: commenting comments</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/536100#M73953</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/238489"&gt;@tfarkas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The approach&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;suggested to you is what I'm using as well. It's an approach that just works for any code and comment combinations. I'm calling my "commenting out" macro normally "%macro null;"&lt;/P&gt;
&lt;PRE&gt;%macro null;
&amp;nbsp; &amp;nbsp;.... here all the code I don't want to execute
%mend;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Feb 2019 00:53:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/536100#M73953</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-02-16T00:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: difficulty developing in proc sql: commenting comments</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/536446#M73967</link>
      <description>&lt;P&gt;One possibility is to use macro comments (start with %*) instead of normal comment lines (starting with *):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc SQL;
  select *
  from sashelp.cars
  where make = 'Acura' %*filter by make; 
  order by model;
;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Feb 2019 12:13:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/536446#M73967</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2019-02-18T12:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: difficulty developing in proc sql: commenting comments</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/537153#M74003</link>
      <description>&lt;P&gt;This seems the best solution of those in this discussion for my purposes. The code does not get colored or highlighted as a comment (any way to change?), but the code will run fine with the inline macro comment, and chunks of code with inline macro comments can be commented out with &amp;lt;CTRL + /&amp;gt;, which really facilitates development, IMO. Happy to hear dissenting opinions, though.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2019 18:45:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/difficulty-developing-in-proc-sql-commenting-comments/m-p/537153#M74003</guid>
      <dc:creator>tfarkas</dc:creator>
      <dc:date>2019-02-20T18:45:50Z</dc:date>
    </item>
  </channel>
</rss>

