<?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: Export SAS log to external files in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288063#M19651</link>
    <description>Thanks man. What I need is to redirect the log file after I run my program. but I can't add proc printto to statement before my program. The real picture is that I need to check my log after my run my program. This can be easily achieved in SAS BASE through DM command. But I don't find any sort of ways in EG.</description>
    <pubDate>Fri, 29 Jul 2016 08:18:18 GMT</pubDate>
    <dc:creator>Qing_End</dc:creator>
    <dc:date>2016-07-29T08:18:18Z</dc:date>
    <item>
      <title>Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/287838#M19643</link>
      <description>&lt;P&gt;Hi, All.&lt;/P&gt;&lt;P&gt;My working environment transfered from SAS Base to SAS EG in last week. In my working environment, we need to export LOG and analysis log&amp;nbsp;and get a overall summary. In SAS Base environment, I use following statement to export log file.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DM "log;file filename;"&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;But in EG, the DM command is not supported.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;Does anyonce know any statement or functions in EG equal to above statement?&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;Proc printto statement not work in my situation as the proc printto does not export log already exists .&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;Thank you.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2016 15:06:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/287838#M19643</guid>
      <dc:creator>Qing_End</dc:creator>
      <dc:date>2016-07-28T15:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/287842#M19645</link>
      <description>&lt;P&gt;Sorry, why does:&lt;/P&gt;
&lt;P&gt;proc printto log="c:\alogfile.txt";&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not work? &amp;nbsp;Just need to specify the filename, and put that before code you need to run, per:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001330273.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001330273.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2016 15:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/287842#M19645</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-07-28T15:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/287945#M19647</link>
      <description>&lt;P&gt;Click on the Log Tab(Next to Program) , Under Log you see the options export , Sent to ...............Click on export ---&amp;gt; Export as ....Then you save the file to desired destination&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2016 20:13:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/287945#M19647</guid>
      <dc:creator>gravity2726</dc:creator>
      <dc:date>2016-07-28T20:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288013#M19648</link>
      <description>&lt;P&gt;The situation is that I can't just simply put the proc printto code before SAS code.&lt;/P&gt;&lt;P&gt;I need another way to put log which exsist before my code to external file.&lt;/P&gt;&lt;P&gt;Thanks.&lt;img id="manembarrassed" class="emoticon emoticon-manembarrassed" src="https://communities.sas.com/i/smilies/16x16_man-embarrassed.png" alt="Man Embarassed" title="Man Embarassed" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 00:45:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288013#M19648</guid>
      <dc:creator>Qing_End</dc:creator>
      <dc:date>2016-07-29T00:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288014#M19649</link>
      <description>Yeah, this is actually a way. But in this way I have to click this button every time, It is time-consuming.</description>
      <pubDate>Fri, 29 Jul 2016 00:56:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288014#M19649</guid>
      <dc:creator>Qing_End</dc:creator>
      <dc:date>2016-07-29T00:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288060#M19650</link>
      <description>&lt;P&gt;Sorry, your process isn't clear. &amp;nbsp;You can't run code? &amp;nbsp;Do the files already exist then? &amp;nbsp;If so you would need some sort of OS scripting to copy them across. &amp;nbsp;What is the clear and concise process you are doing, indicate at what point you need to redirect the log (if indeed redirecting the log is what we are talking about). &amp;nbsp;Can't remember about EG setup, but SAS has autoexec. &amp;nbsp;You could also create a run_all program separate from what you have, e.g.:&lt;BR /&gt;%inc (file=);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; proc printto log="&amp;amp;file..txt";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %inc "&amp;amp;file..sas";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; proc printto;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;%mend inc;&lt;/P&gt;
&lt;P&gt;%inc "c:\file1";&lt;/P&gt;
&lt;P&gt;%inc "c:\file2";&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 08:10:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288060#M19650</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-07-29T08:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288063#M19651</link>
      <description>Thanks man. What I need is to redirect the log file after I run my program. but I can't add proc printto to statement before my program. The real picture is that I need to check my log after my run my program. This can be easily achieved in SAS BASE through DM command. But I don't find any sort of ways in EG.</description>
      <pubDate>Fri, 29 Jul 2016 08:18:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288063#M19651</guid>
      <dc:creator>Qing_End</dc:creator>
      <dc:date>2016-07-29T08:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288071#M19652</link>
      <description>&lt;P&gt;Ok, I thnk I see. &amp;nbsp;You run a program (can't run anything else other than that), then once that is run you want to take a copy of the log. &amp;nbsp;In which case you will need to know where the default log is stored, it should be a text file somewhere (unless EG keeps it in memory). &amp;nbsp;You can also re-direct the log in the autoexec - as EG starts up, to a file you want, then you can copy paste that file as you want and it will not interfere with your other program. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 09:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288071#M19652</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-07-29T09:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288079#M19653</link>
      <description>Yeah, exactly. You gave me some hints. I think I need to find where the temporary log file is, then I can use SAS program to analysis it. Thanks man.</description>
      <pubDate>Fri, 29 Jul 2016 09:49:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288079#M19653</guid>
      <dc:creator>Qing_End</dc:creator>
      <dc:date>2016-07-29T09:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288107#M19654</link>
      <description>&lt;P&gt;EG&amp;nbsp;stores the log files temporarily on disk&amp;nbsp;in the Windows&amp;nbsp;%temp% directory in a path with this format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%temp%\SEG&amp;lt;uniqueID&amp;gt;\&amp;lt;uniqueID&amp;gt;\result.log&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;C:\Users\cassmi\AppData\Local\Temp\SEG65492\dd40c683fece4362b2d3e17463b91689\result.log&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could write a script to copy them from here&amp;nbsp;if redirecting the log in autoexec or via proc printto will not meet your needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: EG's project log is also stored in&amp;nbsp;the same&amp;nbsp;path format&amp;nbsp;and file name, so you'd probably want your&amp;nbsp;script to differentiate somehow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Casey&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 13:16:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288107#M19654</guid>
      <dc:creator>CaseySmith</dc:creator>
      <dc:date>2016-07-29T13:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288112#M19655</link>
      <description>&lt;P&gt;Another way you could accomplish is with EG's automation interface.&amp;nbsp; For example, add the following to the EGScript1.vbs file that gets created when you schedule an EG project:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;    '-----
    ' export the log for each program
    '-----
    Dim code
    For Each code in prjObject.CodeCollection
        'MsgBox code.Log.Text
        code.Log.SaveAs "c:\temp\" &amp;amp; code.Name &amp;amp; ".log"
    Next
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example of the full VBS file (I commented out the running and saving of the project.&amp;nbsp; Up to you to decide what you want the script to do.):&lt;/P&gt;
&lt;PRE&gt;Option Explicit
Dim app

Call dowork

'shut down the app
If not (app Is Nothing) Then
    app.Quit
    Set app = Nothing
End If


Sub dowork()
    On Error Resume Next
    '----
    ' Start up Enterprise Guide using the project name
    '----
    Dim prjName
    Dim prjObject

    prjName = "C:\Users\cassmi\Desktop\ExportAllLogs.egp"    'Project Name
      
    Set app = CreateObject("SASEGObjectModel.Application.7.1")
    If Checkerror("CreateObject") = True Then
        Exit Sub
    End If
    
    '-----
    ' open the project
    '-----
    Set prjObject = app.Open(prjName,"")
    If Checkerror("app.Open") = True Then
        Exit Sub
    End If
    
        
    '-----
    ' run the project
    '-----
    'prjObject.run
    'If Checkerror("Project.run") = True Then
    '    Exit Sub
    'End If
    
	
    '-----
    ' export the log for each program
    '-----
    Dim code
    For Each code in prjObject.CodeCollection
        'MsgBox code.Log.Text
        code.Log.SaveAs "c:\temp\" &amp;amp; code.Name &amp;amp; ".log"
    Next
            
    '-----
    ' Save the new project
    '-----
    'prjObject.Save
    'If Checkerror("Project.Save") = True Then
    '    Exit Sub
    'End If
    
    '-----
    ' Close the project
    '-----
    prjObject.Close
    If Checkerror("Project.Close") = True Then
        Exit Sub
    End If
       
End Sub

Function Checkerror(fnName)
    Checkerror = False
    
    Dim strmsg
    Dim errNum
    
    If Err.Number &amp;lt;&amp;gt; 0 Then
        strmsg = "Error #" &amp;amp; Hex(Err.Number) &amp;amp; vbCrLf &amp;amp; "In Function " &amp;amp; fnName &amp;amp; vbCrLf &amp;amp; Err.Description
        'MsgBox strmsg  'Uncomment this line if you want to be notified via MessageBox of Errors in the script.
        Checkerror = True
    End If
         
End Function&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Jul 2016 13:43:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288112#M19655</guid>
      <dc:creator>CaseySmith</dc:creator>
      <dc:date>2016-07-29T13:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288118#M19656</link>
      <description>&lt;P&gt;Thank you Casey. Through I have limited knowledge in VBS, will try to figure out the code you provided. Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 13:56:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288118#M19656</guid>
      <dc:creator>Qing_End</dc:creator>
      <dc:date>2016-07-29T13:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288138#M19657</link>
      <description>&lt;P&gt;I am sorry, but WHY would you want to replicate that process? &amp;nbsp;It is not a process you should normally use in Display Manger anyway.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you run code in an EG project doesn't it already save the log in the project file? &amp;nbsp;If for some reason you want to see it later perhaps you can just treat the EG project file like the ZIP file that it is and extract the log from there?&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, 29 Jul 2016 14:44:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288138#M19657</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-07-29T14:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288152#M19658</link>
      <description>&lt;P&gt;Just wanted to say I had this same question/problem about trying to access the log programmitally.&amp;nbsp; Like you, in interactive PC SAS, I used DM commands to save the current log to a file and then post-process it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Helpful to know that the EG log file is stored in a temp file on the PC.&amp;nbsp; But my guess is this still wouldn't work for my use case.&amp;nbsp; That is, in interactive PC SAS (and batch SAS) I can submit all together:&lt;/P&gt;
&lt;PRE&gt;*data step;
*proc step;
*blah blah blah;
%logPostProcess()&lt;/PRE&gt;
&lt;P&gt;And %LogPostProcess will process the log from steps submitted before it.&amp;nbsp;&amp;nbsp;In EG connected to a remote SAS session, I would assume the code has to complete executing before the log file gets back to the local PC.&amp;nbsp; And as I type I realize even if the log file came back to my local PC in real time, it wouldn't matter, because my %logPostProcess executing on the remote server couldn't read it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have ended up using the PROC PRINTTO approach when I want to do log scanning in EG.&amp;nbsp; It's a bid of a hassle, but works okay.&amp;nbsp; You can set up pre-code and post-code to run the PROC PRINTTO before and after every EG submission (or on EG conection to server).&amp;nbsp; So you don't necessarily need to revise the main code.&amp;nbsp; My process is like:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;PROC PRINTTO redirects log to a file.&lt;/LI&gt;
&lt;LI&gt;Main code runs.&lt;/LI&gt;
&lt;LI&gt;PROC PRINTTO redirects log back to log window.&lt;/LI&gt;
&lt;LI&gt;Post process log file.&lt;/LI&gt;
&lt;LI&gt;Read the log file and stream in back to log window (so I can see log in EG log window).&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, I'm only using EG for development work.&amp;nbsp; It was important to me to keep an approach that&amp;nbsp;works for EG and Interactive PC SAS and batch jobs and stored process jobs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think this would be easier to manage if it were possible to specify ALTLOG option during a SAS session.&amp;nbsp; So you could just turn ALTLOG on and off any time you want to get a file copy of the log.&amp;nbsp; If you agree, please vote up:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SASware-Ballot-Ideas/Allow-ALTLOG-to-be-specified-on-OPTIONS-statement/idi-p/219628" target="_blank"&gt;https://communities.sas.com/t5/SASware-Ballot-Ideas/Allow-ALTLOG-to-be-specified-on-OPTIONS-statement/idi-p/219628&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Q.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 15:09:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288152#M19658</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2016-07-29T15:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288435#M19665</link>
      <description>&lt;P&gt;Hi Tom. I'd like to replicate the DM statement because I need to check the log after I run my program since the Error and Warning is not enough for me. Some special Note need to be checked, such as Note: Missing valued be generated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to check every log after I run my program, So I want find a more convenient way to do this. Not just Zip and Unzip, It's time consuming.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTY,In SAS Base environment, I used to do this by using SAS/SCL. Then I can check my log just push some keys.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 01:15:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288435#M19665</guid>
      <dc:creator>Qing_End</dc:creator>
      <dc:date>2016-08-01T01:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288437#M19666</link>
      <description>&lt;P&gt;Hi, Quentin. Thank you.&lt;BR /&gt;I think we met the same issue.&lt;BR /&gt;I appreciated the way you provided. I think it's a good solution.&lt;BR /&gt;But I am a little confused "&lt;SPAN&gt;You can set up pre-code and post-code to run the PROC PRINTTO before and after every EG submission&lt;/SPAN&gt;" as i'm a newbee in SAS EG.&lt;/P&gt;&lt;P&gt;Could you please explain how to achieve this task?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 01:24:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288437#M19666</guid>
      <dc:creator>Qing_End</dc:creator>
      <dc:date>2016-08-01T01:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288566#M19676</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warning: I haven't played with this approach, but I think it should work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In recent versions of EG (I'm using 6.1) if you go to tools-&amp;gt;Options-&amp;gt;SAS Program there are options where you can specify&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Submit SAS Code when server is connected&lt;/LI&gt;
&lt;LI&gt;Insert custom SAS code before submitted code&lt;/LI&gt;
&lt;LI&gt;Insert custom SAS code after submitted code&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can think of Submit SAS Code when server is connected as similar to an autoexec.&amp;nbsp; When EG starts, it connects to a server, and that code will run automatically.&amp;nbsp;&amp;nbsp;&amp;nbsp; In general, when you submit code in EG, EG adds a bunch of wrapper code to communicate with the server etc.&amp;nbsp; The insert custom SAS code before/after submitted code allows you to specify additional SAS code that should be added to that wrapper.&amp;nbsp; That code would be executed every time you submit code in EG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So my thought is set Submit SAS Code when server is connected to be:&lt;/P&gt;
&lt;PRE&gt;filename mylog "%sysfunc(pathname(work))/MyLog.log";&lt;/PRE&gt;
&lt;P&gt;Set Insert custom SAS code before submitted code to be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc printto log=mylog new;
run;
&lt;/PRE&gt;
&lt;P&gt;Set Insert custom SAS code after submitted code to be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc printto log=log;
run;

data _null_;
  infile mylog;
  input;
  *log scanning etc;

  putlog _infile_;  *send contents of mylog back to log window;
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you have a setup like that, any time you submit code from EG it would:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Start a proc printto block.&lt;/LI&gt;
&lt;LI&gt;Execute the submitted code&lt;/LI&gt;
&lt;LI&gt;Close the proc printto block, scan the log, and write the log file to the log window.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So instead of taking the PC SAS approach of using DM commands to copy the content of log window to a file when you want to log scan, you take the opposite approach of always writing the log to a file.&amp;nbsp;&amp;nbsp;&amp;nbsp; I think something like that could work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 12:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288566#M19676</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2016-08-01T12:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Export SAS log to external files</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288618#M19686</link>
      <description>&lt;P&gt;Thank you so much Quentin.&lt;/P&gt;&lt;P&gt;The solution you provided is very creative and useful.&lt;/P&gt;&lt;P&gt;I think it will work and I will post this in this post once I have finished my experiment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 15:07:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Export-SAS-log-to-external-files/m-p/288618#M19686</guid>
      <dc:creator>Qing_End</dc:creator>
      <dc:date>2016-08-01T15:07:30Z</dc:date>
    </item>
  </channel>
</rss>

