<?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: Log file sequence anomolies in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Log-file-sequence-anomolies/m-p/963145#M375286</link>
    <description>&lt;P&gt;Then either set the SOURCE2 option or add the /SOURCE2 option to the %INCLUDE statement.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Apr 2025 14:55:09 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-04-01T14:55:09Z</dc:date>
    <item>
      <title>Log file sequence anomolies</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Log-file-sequence-anomolies/m-p/963114#M375267</link>
      <description>&lt;P&gt;I am parsing the SAS log to extract data about writing files: the filename, lines written summary and cpu and real time. SCAPROC is not available to me because it is already running by a system that runs my code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The log file issue is that most frequently the cpu &amp;amp; real time loglines are last in a sequence of messages, but sometimes the cpu &amp;amp; real time messages come before &lt;EM&gt;lines written summary&amp;nbsp;&lt;/EM&gt;part&lt;EM&gt;.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example: The log file normally has&lt;/P&gt;
&lt;PRE&gt;NOTE: The file library OUT is:
      Directory=#####,
      Owner Name=webtrust,Group Name=webtrust,
      Access Permission=drwxrwxrwx,
      Last Modified=24Jan2025:07:01:26

NOTE: The file OUT(*****.csv) is:
      Filename=#####/*****.csv,
      Owner Name=%%%%%%%%,Group Name=webtrust,
      Access Permission=-rw-rw-rw-,
      Last Modified=24Jan2025:07:01:26

NOTE: A total of 5509 records were written to the file library OUT.
      The minimum record length was 80.
      The maximum record length was 125.
NOTE: 5509 records were written to the file OUT(*****.csv).
      The minimum record length was 80.
      The maximum record length was 125.
NOTE: There were 5508 observations read from the data set INP.######.&lt;BR /&gt;NOTE: DATA statement used (Total process time): &lt;FONT color="#FF0000"&gt;*** Most of the time these 3 lines are last in the sequence of log messages ***&lt;/FONT&gt;&lt;BR /&gt;      real time 0.83 seconds &lt;BR /&gt;      cpu time 0.82 seconds&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but infrequently there are cases in which the cpu and real time come before the summary of the lines written&lt;/P&gt;
&lt;PRE&gt;NOTE: The file library OUT is:
      Directory=#####,
      Owner Name=webtrust,Group Name=webtrust,
      Access Permission=drwxrwxrwx,
      Last Modified=24Jan2025:07:01:26

NOTE: The file OUT(*****.csv) is:
      Filename=#####/*****.csv,
      Owner Name=%%%%%%%%,Group Name=webtrust,
      Access Permission=-rw-rw-rw-,
      Last Modified=24Jan2025:07:01:26

&lt;STRONG&gt;NOTE: DATA statement used (Total process time): &lt;FONT color="#FF0000"&gt;*** Normally these 3 lines are last in the sequence of log messages ***&lt;/FONT&gt;
      real time           0.83 seconds
      cpu time            0.82 seconds
&lt;/STRONG&gt;      
NOTE: A total of 5509 records were written to the file library OUT.
      The minimum record length was 80.
      The maximum record length was 125.
NOTE: 5509 records were written to the file OUT(*****.csv).
      The minimum record length was 80.
      The maximum record length was 125.
NOTE: There were 5508 observations read from the data set INP.######.&lt;/PRE&gt;
&lt;P&gt;Any ideas why this happens?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 13:17:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Log-file-sequence-anomolies/m-p/963114#M375267</guid>
      <dc:creator>RichardAD</dc:creator>
      <dc:date>2025-04-01T13:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Log file sequence anomolies</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Log-file-sequence-anomolies/m-p/963129#M375276</link>
      <description>it's a little bit hard to tell what's going on without having OPTIONS mprint; turned on.  I would suggest doing that and re-posting the log.</description>
      <pubDate>Tue, 01 Apr 2025 14:09:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Log-file-sequence-anomolies/m-p/963129#M375276</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2025-04-01T14:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Log file sequence anomolies</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Log-file-sequence-anomolies/m-p/963134#M375278</link>
      <description>There is no macro involved.  The code being executed is generated in a data _null_ and written to a temp file which is then %included.</description>
      <pubDate>Tue, 01 Apr 2025 14:23:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Log-file-sequence-anomolies/m-p/963134#M375278</guid>
      <dc:creator>RichardAD</dc:creator>
      <dc:date>2025-04-01T14:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Log file sequence anomolies</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Log-file-sequence-anomolies/m-p/963145#M375286</link>
      <description>&lt;P&gt;Then either set the SOURCE2 option or add the /SOURCE2 option to the %INCLUDE statement.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 14:55:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Log-file-sequence-anomolies/m-p/963145#M375286</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-04-01T14:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Log file sequence anomolies</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Log-file-sequence-anomolies/m-p/963146#M375287</link>
      <description>&lt;P&gt;The generated code is a code-gen block, such as below. One per dataset in a library&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1448      +data _null_ ;
1449      +  file out (&lt;FONT color="#993300"&gt;&amp;lt;dataset&amp;gt;&lt;/FONT&gt;.csv) dlm=',' termstr=crlf ;
1450      +  if _n_ = 1 then
SYMBOLGEN:  Macro variable SAS2CSV_COL_NAMES resolves to 
            &lt;FONT color="#993300"&gt;&amp;lt;comma-separated-list-of-column-names&amp;gt;&lt;/FONT&gt;
1450     !+                  put "&lt;FONT color="#993300"&gt;&amp;amp;sas2csv_col_names&lt;/FONT&gt;" ;
1451      +  set inp.&lt;FONT color="#993300"&gt;&amp;lt;dataset&amp;gt;&lt;/FONT&gt; ;
1452      +  format _character_ $quote32767. ;
1453      +  put (_all_) (:) ;
1454      +run ;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The core of the open-code generator is&lt;/P&gt;
&lt;PRE&gt;data _null_ ;
&lt;FONT size="5"&gt;&lt;FONT size="4"&gt;  file&lt;/FONT&gt; gencode ;&lt;/FONT&gt;
  do z = 0 by 0 until (z) ;
    set inp_tables end = z ;
    put "proc sql noprint ;"
      / "  select name into :sas2csv_col_names separated by ',' from sas2csv_inp_columns"
      / "  where  upcase (memname) = " qmemname "order varnum"
      / "  ;"
      / "quit ;"
      / ;
    put "data _null_ ;"
      / "  file out (" lmemname +(-1)".csv) dlm=',' termstr=crlf ;"
      / '  if _n_ = 1 then put "&amp;amp;sas2csv_col_names" ;'           /* header row */
      / "  set inp." lmemname ";"
      / '  format _character_ $quote32767. ;'
      / "  put (_all_) (:) ;"                                    /* data rows */
      / "run ;"
      / ;
  end ;
run ;
%inc &lt;FONT size="5"&gt;gencode&lt;/FONT&gt; / source2 ;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 15:11:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Log-file-sequence-anomolies/m-p/963146#M375287</guid>
      <dc:creator>RichardAD</dc:creator>
      <dc:date>2025-04-01T15:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Log file sequence anomolies</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Log-file-sequence-anomolies/m-p/963147#M375288</link>
      <description>&lt;P&gt;Does having the %INCLUDE writing the source code prevent the re-ordering of the blocks of log lines?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might also try running with the logparm option set to prevent buffering of writes to the SAS log and see if that effects the ordering of the blocks of lines.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;-logparm 'write=immediate'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you test without the process that in invoking&amp;nbsp;&lt;SPAN&gt;SCAPROC?&amp;nbsp; Perhaps that is what is interfering with the ordering of the blocks of lines.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ultimately you will probably need to ask SAS technical support to look into this issue.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 15:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Log-file-sequence-anomolies/m-p/963147#M375288</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-04-01T15:20:41Z</dc:date>
    </item>
  </channel>
</rss>

