<?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 Best Practice Regarding Creating New Log File in New Location in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Best-Practice-Regarding-Creating-New-Log-File-in-New-Location/m-p/797987#M313754</link>
    <description>&lt;P&gt;Just did some searching and reading on SAS log file directing.&amp;nbsp; And, phew!, seems to be a crazy topic, all across the board.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simply put, I'd like to process several datasets, one at a time:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;aaa.sas7bdat&lt;/P&gt;
&lt;P&gt;bbb.sas7bdat&lt;/P&gt;
&lt;P&gt;ccc.sas7bdat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each dataset resides within its own folder:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;c:\1\aaa\aaa.sas7bdat&lt;/P&gt;
&lt;P&gt;c:\1\bbb\bbb.sas7bdat&lt;/P&gt;
&lt;P&gt;c:\1\ccc\ccc.sas7bdat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(I'd like to process all the datasets using a macro.&amp;nbsp; But will inquire about how to do that tomorrow.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For now, when processing&amp;nbsp;aaa.sas7bdat, I would like to create a log -- log_aaa.txt -- within&amp;nbsp;c:\1\aaa\.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Following completion of that process, I'd like to move on to bbb.sas7bdat.&amp;nbsp; And during the process create a new log file -- log_bbb.txt.&amp;nbsp; That file should reside in the respective c:\1\bbb\.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On and on....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You get the picture?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any sage advice on how best to do this will be greatly appreciated.&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;
&lt;P&gt;Nicholas Kormanik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Feb 2022 10:31:33 GMT</pubDate>
    <dc:creator>NKormanik</dc:creator>
    <dc:date>2022-02-23T10:31:33Z</dc:date>
    <item>
      <title>Best Practice Regarding Creating New Log File in New Location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Best-Practice-Regarding-Creating-New-Log-File-in-New-Location/m-p/797987#M313754</link>
      <description>&lt;P&gt;Just did some searching and reading on SAS log file directing.&amp;nbsp; And, phew!, seems to be a crazy topic, all across the board.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simply put, I'd like to process several datasets, one at a time:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;aaa.sas7bdat&lt;/P&gt;
&lt;P&gt;bbb.sas7bdat&lt;/P&gt;
&lt;P&gt;ccc.sas7bdat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each dataset resides within its own folder:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;c:\1\aaa\aaa.sas7bdat&lt;/P&gt;
&lt;P&gt;c:\1\bbb\bbb.sas7bdat&lt;/P&gt;
&lt;P&gt;c:\1\ccc\ccc.sas7bdat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(I'd like to process all the datasets using a macro.&amp;nbsp; But will inquire about how to do that tomorrow.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For now, when processing&amp;nbsp;aaa.sas7bdat, I would like to create a log -- log_aaa.txt -- within&amp;nbsp;c:\1\aaa\.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Following completion of that process, I'd like to move on to bbb.sas7bdat.&amp;nbsp; And during the process create a new log file -- log_bbb.txt.&amp;nbsp; That file should reside in the respective c:\1\bbb\.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On and on....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You get the picture?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any sage advice on how best to do this will be greatly appreciated.&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;
&lt;P&gt;Nicholas Kormanik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 10:31:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Best-Practice-Regarding-Creating-New-Log-File-in-New-Location/m-p/797987#M313754</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2022-02-23T10:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Best Practice Regarding Creating New Log File in New Location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Best-Practice-Regarding-Creating-New-Log-File-in-New-Location/m-p/797988#M313755</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc printto log="c:\1\aaa\log_aaa.txt"; /* Re-direct log to the file named */
run;

/* Any code for data set aaa goes here */

proc printto; /* Turns off sending log to file named above */
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Feb 2022 13:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Best-Practice-Regarding-Creating-New-Log-File-in-New-Location/m-p/797988#M313755</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-23T13:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Best Practice Regarding Creating New Log File in New Location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Best-Practice-Regarding-Creating-New-Log-File-in-New-Location/m-p/797989#M313756</link>
      <description>&lt;P&gt;This should get you an idea:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro process(loc=);

proc printto log="c:\1\&amp;amp;loc.\log_&amp;amp;loc..txt";
run;

libname process "c:\1\&amp;amp;loc.";

data temp;
set process.&amp;amp;aaa.;
/* further processing */
run;

proc printto log=log; /* reroute to default */
run;

%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then call that repeatedly:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%process(loc=aaa);
%process(loc=bbb);
%process(loc=ccc);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Feb 2022 10:54:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Best-Practice-Regarding-Creating-New-Log-File-in-New-Location/m-p/797989#M313756</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-23T10:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Best Practice Regarding Creating New Log File in New Location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Best-Practice-Regarding-Creating-New-Log-File-in-New-Location/m-p/798271#M313825</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; Clear as day!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp; Uhhh.....&amp;nbsp; (#@%!)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 22:47:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Best-Practice-Regarding-Creating-New-Log-File-in-New-Location/m-p/798271#M313825</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2022-02-23T22:47:41Z</dc:date>
    </item>
  </channel>
</rss>

