<?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 output code only? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617620#M19093</link>
    <description>Thank you so much for your reply. This SAS file contains complicated data cleaning process using multiple data sources. I want to collect all raw variables used in this data sources. Due to the complexity of this SAS file, it is very tortuous for me to find out these variables used in naive and manual way. So I was trying to use Python to scrape certain variables. This would require me to input the giant SAS code as a string into Python with all comments removed. These comments are mostly standalone, separated from code (thank you for pointing out these question). hope this makes sense.</description>
    <pubDate>Wed, 15 Jan 2020 22:13:22 GMT</pubDate>
    <dc:creator>changxuosu</dc:creator>
    <dc:date>2020-01-15T22:13:22Z</dc:date>
    <item>
      <title>how to output code only?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617606#M19090</link>
      <description>&lt;P&gt;Hi SAS Community!&lt;/P&gt;&lt;P&gt;Happy new year to everyone!&lt;/P&gt;&lt;P&gt;I have a question that needs help from you. really appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I have a SAS file with 500 lines of code plus 200 lines of comment.&lt;/P&gt;&lt;P&gt;Does anyone know how to delete all these comments by some quick method, instead of manually?&lt;/P&gt;&lt;P&gt;Is there any code or tool that I can leverage to complete this task for me, so that I don't need to manually look for comments and delete them by hand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 21:47:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617606#M19090</guid>
      <dc:creator>changxuosu</dc:creator>
      <dc:date>2020-01-15T21:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to output code only?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617609#M19091</link>
      <description>Why would you delete all your comments?&lt;BR /&gt;&lt;BR /&gt;Is a particular standard used in your program? Are all the comments the same type, ie *; or /**/ or %*; &lt;BR /&gt;&lt;BR /&gt;Are all comments separated from code, or can they be embedded in the code as well?&lt;BR /&gt;&lt;BR /&gt;eg of separated:&lt;BR /&gt;&lt;BR /&gt;*this calculates summary statistics;&lt;BR /&gt;proc mean data=sashelp.class; run;&lt;BR /&gt;&lt;BR /&gt;*this is embedded;&lt;BR /&gt;proc mean data=sashelp.class /*input data set*/&lt;BR /&gt;                    N Mean NMISS /*control statistics displayed*/&lt;BR /&gt;;&lt;BR /&gt;run;</description>
      <pubDate>Wed, 15 Jan 2020 21:53:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617609#M19091</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-01-15T21:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to output code only?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617620#M19093</link>
      <description>Thank you so much for your reply. This SAS file contains complicated data cleaning process using multiple data sources. I want to collect all raw variables used in this data sources. Due to the complexity of this SAS file, it is very tortuous for me to find out these variables used in naive and manual way. So I was trying to use Python to scrape certain variables. This would require me to input the giant SAS code as a string into Python with all comments removed. These comments are mostly standalone, separated from code (thank you for pointing out these question). hope this makes sense.</description>
      <pubDate>Wed, 15 Jan 2020 22:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617620#M19093</guid>
      <dc:creator>changxuosu</dc:creator>
      <dc:date>2020-01-15T22:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to output code only?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617621#M19094</link>
      <description>I don't have time to get into this at the moment, but check out PROC SCAPROC and search on lexjansen.com for log parsers which can help with what you're trying to do as well. If your data is hitting a server, there may be some other ways to get this info as well.</description>
      <pubDate>Wed, 15 Jan 2020 22:24:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617621#M19094</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-01-15T22:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to output code only?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617627#M19096</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/193702"&gt;@changxuosu&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're using the Enhanced Editor (i.e., the default program editor in a Display Manager SAS session under Windows) or some similar editor (perhaps in Enterprise Guide), you can use the familiar Replace dialog:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="replace_dialog.png" style="width: 473px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35373iDDE17E1AA7E3F211/image-size/large?v=v2&amp;amp;px=999" role="button" title="replace_dialog.png" alt="replace_dialog.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It's important to select the checkbox "Regular expression search" and to select "Find in comments only" from the "Find in:" drop-down list. Then you can use the period (.) -- the regular expression for "any character except carriage return" -- as the search expression, leave the "Replace with:" field empty and (if you're courageous) hit "Replace All".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This should remove all comments including the &lt;FONT face="courier new,courier"&gt;/*&lt;/FONT&gt; etc. characters -- with one exception: The percent signs of macro comments &lt;FONT face="courier new,courier"&gt;&lt;FONT color="#FF0000"&gt;%&lt;/FONT&gt;* ... ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, if you have some of these, you may want to &lt;EM&gt;first&lt;/EM&gt; replace the combination "&lt;FONT face="courier new,courier"&gt;%*&lt;/FONT&gt;" with a single asterisk (i.e., remove the % sign) using the Replace dialog &lt;EM&gt;without&lt;/EM&gt;&amp;nbsp;selecting the&amp;nbsp;"Regular expression search" checkbox and with the "Find &lt;EM&gt;in code and comments&lt;/EM&gt;" setting and &lt;EM&gt;then&lt;/EM&gt;, as the second step, use the technique described above to remove the comments.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 23:06:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617627#M19096</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-01-15T23:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to output code only?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617652#M19103</link>
      <description>wow! amazing! i can never think of this smart trick by myself until seeing your post! thanks a lot! Really appreciate it! I really feel the positive emergy coming from SAS community</description>
      <pubDate>Thu, 16 Jan 2020 03:00:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617652#M19103</guid>
      <dc:creator>changxuosu</dc:creator>
      <dc:date>2020-01-16T03:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to output code only?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617776#M19131</link>
      <description>thank you so much Reeza, the "Proc Scaproc" you mentioned opened a new door for me! thank you so much for knowledge sharing, I really really really appreciate it!</description>
      <pubDate>Thu, 16 Jan 2020 15:00:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617776#M19131</guid>
      <dc:creator>changxuosu</dc:creator>
      <dc:date>2020-01-16T15:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to output code only?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617814#M19135</link>
      <description>Hi Reeza, I looked into PROC SCAPROC, it's very powerful to analyze code to extract information such as input dataset, output dataset, leveraging the /* JOBSPLIT */ comment. However, I don't know how we can extract variable names using text file produced by PROC SCAPROC. Any ideas, inputs, suggestions are greatly appreciated.</description>
      <pubDate>Thu, 16 Jan 2020 16:16:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-output-code-only/m-p/617814#M19135</guid>
      <dc:creator>changxuosu</dc:creator>
      <dc:date>2020-01-16T16:16:02Z</dc:date>
    </item>
  </channel>
</rss>

