<?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: Reporting the SAS Code Lines by Program in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reporting-the-SAS-Code-Lines-by-Program/m-p/601099#M173825</link>
    <description>&lt;P&gt;I would actually ask for a definition of "line" for this purpose.&lt;/P&gt;
&lt;P&gt;A "line" could be a physical line in a file as defined by the OS new line indicator.&lt;/P&gt;
&lt;P&gt;A "line" could also be a complete SAS statement as ended by a ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So how many lines would this be:&lt;/P&gt;
&lt;P&gt;proc freq data=sashelp.class; tables sex*age/output out=work.counts. run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or this:&lt;/P&gt;
&lt;P&gt;proc freq&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data=sashelp.class&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; tables sex*&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; age/output&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out=work.counts.&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't find "line counts" terribly informative but that may just be me.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Nov 2019 21:03:38 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-11-01T21:03:38Z</dc:date>
    <item>
      <title>Reporting the SAS Code Lines by Program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reporting-the-SAS-Code-Lines-by-Program/m-p/600902#M173769</link>
      <description>&lt;P&gt;In order to count the number of SAS Code Lines by program (under windows environment).&lt;/P&gt;
&lt;P&gt;As example, Let’s take the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Folder /PGM_1.sas&lt;/P&gt;
&lt;P&gt;Folder/toto.sas&lt;/P&gt;
&lt;P&gt;………&lt;/P&gt;
&lt;P&gt;Folder/PGM_N&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible to report the number of the Code lines by Program as follows?&lt;/P&gt;
&lt;P&gt;PGM &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Code lines number&lt;/P&gt;
&lt;P&gt;PGM_1.sas&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;XXX&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 09:19:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reporting-the-SAS-Code-Lines-by-Program/m-p/600902#M173769</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2019-11-01T09:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reporting the SAS Code Lines by Program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reporting-the-SAS-Code-Lines-by-Program/m-p/600908#M173772</link>
      <description>&lt;P&gt;Something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data lines;
  length fnam sasfile $200;
  infile 'W:\SAS_DK\PersonligeMapper\lasseso\*.sas' filename=fnam end=done;
  sasfile=fnam;
  do lines=0 by 1 until(fnam ne sasfile or done);
    input;
    end;
  sasfile=scan(sasfile,-1,'\');
  output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Nov 2019 09:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reporting-the-SAS-Code-Lines-by-Program/m-p/600908#M173772</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2019-11-01T09:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reporting the SAS Code Lines by Program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reporting-the-SAS-Code-Lines-by-Program/m-p/601097#M173824</link>
      <description>&lt;P&gt;Thank very much..That's very kind from you.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 20:57:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reporting-the-SAS-Code-Lines-by-Program/m-p/601097#M173824</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2019-11-01T20:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Reporting the SAS Code Lines by Program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reporting-the-SAS-Code-Lines-by-Program/m-p/601099#M173825</link>
      <description>&lt;P&gt;I would actually ask for a definition of "line" for this purpose.&lt;/P&gt;
&lt;P&gt;A "line" could be a physical line in a file as defined by the OS new line indicator.&lt;/P&gt;
&lt;P&gt;A "line" could also be a complete SAS statement as ended by a ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So how many lines would this be:&lt;/P&gt;
&lt;P&gt;proc freq data=sashelp.class; tables sex*age/output out=work.counts. run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or this:&lt;/P&gt;
&lt;P&gt;proc freq&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data=sashelp.class&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; tables sex*&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; age/output&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out=work.counts.&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't find "line counts" terribly informative but that may just be me.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 21:03:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reporting-the-SAS-Code-Lines-by-Program/m-p/601099#M173825</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-01T21:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Reporting the SAS Code Lines by Program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reporting-the-SAS-Code-Lines-by-Program/m-p/601340#M173927</link>
      <description>&lt;P&gt;I got this private message from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Unfortunately, I am getting correct results from your suggestion only for the first sas program file encountered.&amp;nbsp; I have 4 sas program files in my directory with 5, 5, 5, and 3 lines respectively. &amp;nbsp; But this program reports 5,4,4, and 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like the UNTIL fnam^=sasfile occurs at the start of the next fnam.&amp;nbsp; Since your counter starts at zero, its not a problem for the&amp;nbsp; first prog.&amp;nbsp; But that line is not counted for the other files, which are all undercounted by 1.&amp;nbsp; In addition the UNTIL DONE condition occurs at the end of the last program, so it&amp;nbsp; is undercounted by 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So, you may have to tweak my program a bit to get things completely right.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 10:48:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reporting-the-SAS-Code-Lines-by-Program/m-p/601340#M173927</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2019-11-04T10:48:06Z</dc:date>
    </item>
  </channel>
</rss>

