<?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: SAS log cut off the first 95 lines of code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377440#M90631</link>
    <description>Hi Shmuel - yes, I do have unique log file names on each script. If the issue is caused by being help by previous script/session, then is there a way to release it?&lt;BR /&gt;&lt;BR /&gt;I rebooted my computer this morning, opened a new SAS session, removed the DM line at the top, submitted only one script; but the issue still occur.</description>
    <pubDate>Wed, 19 Jul 2017 16:21:53 GMT</pubDate>
    <dc:creator>jtran001</dc:creator>
    <dc:date>2017-07-19T16:21:53Z</dc:date>
    <item>
      <title>SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377336#M90594</link>
      <description>&lt;P&gt;Hello, we've just upgraded to SAS v9.04.01 on windows 7.&amp;nbsp; The programs I run created a log file and also output the executed codes to the log window for QC.&amp;nbsp; Since the upgrade, sometimes the log doesn't display the first 95 lines of executed codes.&amp;nbsp; Could someone please help?&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 14:09:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377336#M90594</guid>
      <dc:creator>jtran001</dc:creator>
      <dc:date>2017-07-19T14:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377352#M90596</link>
      <description>&lt;P&gt;It would likely help to show 1) the code that generates the issue and 2) a log from running that code.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 14:32:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377352#M90596</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-07-19T14:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377355#M90597</link>
      <description>&lt;P&gt;It is difficult to wnow without having the running code.&lt;/P&gt;
&lt;P&gt;I suppose you have OPTIONS NOSOURCE at the begining of the code and somewhere later,&lt;/P&gt;
&lt;P&gt;just before the code displayed in the log, there is: OPTIONS SOURCE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other possibility is using PROC PRINTTO LOG=... - in order to write the log to a file, and later&lt;/P&gt;
&lt;P&gt;closing it with PROC PRINTTO; RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If those are not the cases, please post full code and the full log of that code run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 14:39:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377355#M90597</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-19T14:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377371#M90602</link>
      <description>&lt;P&gt;Hi ballardw, I've attached the script &amp;amp; log for your references.&amp;nbsp; The strange thing this issue occur at random.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 15:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377371#M90602</guid>
      <dc:creator>jtran001</dc:creator>
      <dc:date>2017-07-19T15:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377376#M90605</link>
      <description>&lt;P&gt;Hi Shmuel, ballardw asked for the same thing as you.&amp;nbsp; I attached a script and log in my response to ballardw.&amp;nbsp; Would you please check them out there?&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 15:05:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377376#M90605</guid>
      <dc:creator>jtran001</dc:creator>
      <dc:date>2017-07-19T15:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377386#M90608</link>
      <description>&lt;P&gt;I haven't find in your log, neither NOSOURCE nor PRINTTO strings,&lt;/P&gt;
&lt;P&gt;but there are DM statements relation to LOG (lines 1, 574);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you running scripts in a chain? do you have the issue running a script as first action entering SAS session?&lt;/P&gt;
&lt;P&gt;Maybe the issue is the result of previous running code - the 95 absent lines are written to the previous code log ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On log line 574 you have:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;dm log 'file "K:\HSE\HEDIS\&amp;amp;rptyr\documentation\measures\A P C\APC Numerator &amp;amp;memschema..log" 
        replace' log;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;that makes me suspicious. Try to run the code without it or move it to the beginning.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 15:22:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377386#M90608</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-19T15:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377432#M90627</link>
      <description>Hi Shmuel - This issue occurs recently since the SAS v9.4 upgrade. The dm log on line 574 you cited had always been in the script. The one that's new is the DM statement at the top.&lt;BR /&gt;&lt;BR /&gt;I submitted the scripts one after another in multiple SAS sessions. When one finished, I closed that session, started a new one to submit a new script. The issue happens at random. Sometimes I don't have the issue running a script as the very first one in a first SAS session. Sometime I do like now.</description>
      <pubDate>Wed, 19 Jul 2017 16:10:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377432#M90627</guid>
      <dc:creator>jtran001</dc:creator>
      <dc:date>2017-07-19T16:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377436#M90628</link>
      <description>&lt;P&gt;Do you have different/unique log file names on each script?&lt;/P&gt;
&lt;P&gt;Can it be that you are trying to write to a logfile that occasionally is still held by previous script/session/OS ?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 16:15:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377436#M90628</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-19T16:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377440#M90631</link>
      <description>Hi Shmuel - yes, I do have unique log file names on each script. If the issue is caused by being help by previous script/session, then is there a way to release it?&lt;BR /&gt;&lt;BR /&gt;I rebooted my computer this morning, opened a new SAS session, removed the DM line at the top, submitted only one script; but the issue still occur.</description>
      <pubDate>Wed, 19 Jul 2017 16:21:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377440#M90631</guid>
      <dc:creator>jtran001</dc:creator>
      <dc:date>2017-07-19T16:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377443#M90632</link>
      <description>&lt;P&gt;Closing sas session should close all files open. Sometimes the OS is busy and thre is a delay in relaesing a file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have no more ideas and hope someone else will have.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 16:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377443#M90632</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-19T16:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377444#M90633</link>
      <description>Thank you Shmuel for trying.</description>
      <pubDate>Wed, 19 Jul 2017 16:29:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377444#M90633</guid>
      <dc:creator>jtran001</dc:creator>
      <dc:date>2017-07-19T16:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377497#M90646</link>
      <description>&lt;P&gt;The displayed log appears to start at or about the call to the macro %hospice.&lt;/P&gt;
&lt;P&gt;You have 5 other macros that are run before then. Perhaps one or more&amp;nbsp;of those has either another DM 'log;clear'; or onther options that is affecting the log. Were any of those macros changed to take advantage of new features in 9.4?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 18:16:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377497#M90646</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-07-19T18:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377502#M90648</link>
      <description>Hi ballardw - I checked the 5 macros called in before %hospice and none of them used a DM 'log;clear;' statement. The only option they used are "options nomprint nosymbolgen;".&lt;BR /&gt;&lt;BR /&gt;These scripts have been in production since SAS v9.0 or maybe before. They haven't been changed to take advantage of the new features in 9.4 yet.</description>
      <pubDate>Wed, 19 Jul 2017 18:28:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377502#M90648</guid>
      <dc:creator>jtran001</dc:creator>
      <dc:date>2017-07-19T18:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377547#M90675</link>
      <description>&lt;P&gt;Can you post the macro code used as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Locking_Log(measure=APC,run=NUM);  /* check for prior run in HDMPRD */
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jul 2017 19:35:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377547#M90675</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-19T19:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377556#M90678</link>
      <description>&lt;P&gt;Sure.&amp;nbsp; Please see attached.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 19:53:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377556#M90678</guid>
      <dc:creator>jtran001</dc:creator>
      <dc:date>2017-07-19T19:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377627#M90695</link>
      <description>&lt;P&gt;I have checked the code. It deals with a dataset called&amp;nbsp;&lt;STRONG&gt;lock.Locking_Log&amp;nbsp;&lt;/STRONG&gt;which has nothing with the log file.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 00:41:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377627#M90695</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-20T00:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377632#M90697</link>
      <description>&lt;P&gt;If you want to have a clean SAS log file then&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Remove the DM commands from the program(s).&lt;/LI&gt;
&lt;LI&gt;Submit the job from the command line (batch mode) instead of running it interactively.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;If you want help with debugging why the log was cleared provide the code for at least these six macros that your program is calling. Perhaps they also have DM commands in them.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Today;   /* set up macro variable (today) that contains the current date */
%Start_Time;   /* capture date time start of program initiation */
%Locking_Log(measure=APC,run=NUM);  /* check for prior run in HDMPRD */
...
%PPO_STATE(memtable=Member_Elig,measure=APC,excl_rsns=NONE);
...
%med_prime(memtable=Member_Elig,measure=APC,excl_rsns=NONE);
...
%hospice(memtable=Member_Elig,measure=APC,excl_rsns=NONE);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;If you want to step through the program then open it use the PGM (old style editor) instead of the Enhanced Editor. Then turn on the line numbers (if not already one). &amp;nbsp;The submit the program step by step using the SUBTOP command add see which lines of code are clearing the log. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So for the example program you could start with SUBTOP 26 to get the macro variables and options defined.&amp;nbsp;Then you could use SUBTOP 2 to run the first macro call. &amp;nbsp;etc.&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>Thu, 20 Jul 2017 03:33:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377632#M90697</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-07-20T03:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377794#M90736</link>
      <description>Hi Tom, I checked all of those macros and none of them use a DM statement.</description>
      <pubDate>Thu, 20 Jul 2017 14:36:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377794#M90736</guid>
      <dc:creator>jtran001</dc:creator>
      <dc:date>2017-07-20T14:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377802#M90739</link>
      <description>&lt;P&gt;Hi Shmuel, ballardw, and Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I figured out what was causing the issue.&amp;nbsp; After Shmuel suggested maybe the log was still held by the previous script/session/OS, I started checking for consistency uses of the last DM statement on the scripts.&amp;nbsp; I found that some of the DM statement at the end of some of the scripts were modified by one of the analysts using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;dm log 'print file = "K:\...\&amp;amp;mfolder\&amp;amp;measure.-Historic Data Run &amp;amp;memschema..log" replace' LOG;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;instead of&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;dm 'log; file "K:\...\&amp;amp;mfolder\&amp;amp;measure.-Historic Data Run &amp;amp;memschema..log" replace';&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, they didn't put the ods pdf close statement at the end of the script.&amp;nbsp; So, when I submitted this one, it was okay until the subsequent scripts were submitted then the issue occurred.&amp;nbsp; That's why it seemed so random.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made the fix using the &lt;FONT color="#0000FF"&gt;DM 'log; file ....log" replace';&lt;/FONT&gt; and haven't seen the issue since.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all for taking the time to try helping me.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 14:57:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377802#M90739</guid>
      <dc:creator>jtran001</dc:creator>
      <dc:date>2017-07-20T14:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS log cut off the first 95 lines of code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377803#M90740</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/154791"&gt;@jtran001&lt;/a&gt; wrote:&lt;BR /&gt;Hi Tom, I checked all of those macros and none of them use a DM statement.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Does it consistently generate logs without the beginning? Is it always missing the same part?&lt;/P&gt;
&lt;P&gt;As I said before if you really want to produce complete&amp;nbsp;logs then do not run the programs&amp;nbsp;interactively.&lt;/P&gt;
&lt;P&gt;Try debugging by running step by step and examining the log window as you go to see if it is getting cleared.&lt;/P&gt;
&lt;P&gt;Is it that the SAS log window has the full log, but the file that the DM command generates is missing the beginning?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 14:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-log-cut-off-the-first-95-lines-of-code/m-p/377803#M90740</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-07-20T14:59:16Z</dc:date>
    </item>
  </channel>
</rss>

