<?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: How to - Add DATETIME Suffix to Schedule Program Log's in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/251403#M4232</link>
    <description>&lt;P&gt;Linush,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for these information.&lt;/P&gt;</description>
    <pubDate>Sun, 21 Feb 2016 14:58:24 GMT</pubDate>
    <dc:creator>turcay</dc:creator>
    <dc:date>2016-02-21T14:58:24Z</dc:date>
    <item>
      <title>How to - Add DATETIME Suffix to Schedule Program Log's</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250568#M4164</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to daily scheduling my SAS projects in Windows operarting system. I want&amp;nbsp;to see the logs in specified path day to day. I need to add date suffix for the log files. I've found a PROC PRINTTO precedure&amp;nbsp;in the internet but when I execute&amp;nbsp;my&amp;nbsp;schedule code by using PROC PRINTTO procedure (in Prog1.sas as below) I get two logs and they seems piece by piece. I mean the .bat file generates one part of log and the PRINTTO procedure generates the other part of log. I need to see whole log day to day with date suffix. I have a similar Schedule code as below and PROC PRINTTO code as below. I also shared my desired logs results as below. Could you help me ,please ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC PRINTTO&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let T=%SYSFUNC(DATETIME(),DATETIME9.);
%put &amp;amp;T;

proc printto log="&amp;lt;path&amp;gt;\Schedule&amp;amp;T..log";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Schedule Code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME PROG1 "&amp;lt;path&amp;gt;\Prog1.sas";/* PROC PRINTTO procedure is here */
FILENAME PROG2 "&amp;lt;path&amp;gt;\Prog2.sas";
FILENAME PROG3 "&amp;lt;path&amp;gt;\Prog3.sas";


%INCLUDE PROG1 ;
%INCLUDE PROG2 ;
%INCLUDE PROG3 ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Desired Log Results&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1912iF9F777B3908A287F/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Logs.png" title="Logs.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My .bat scripts&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -SYSIN "&amp;lt;path&amp;gt;\Schedule.sas"&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Feb 2016 11:13:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250568#M4164</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-02-17T11:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Add DATETIME Suffix to Schedule Program Log's</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250581#M4165</link>
      <description>&lt;P&gt;You need to determine the name for the log file in the batch and hand it over to SAS with the -log commandline option.&lt;/P&gt;
&lt;P&gt;proc printto does its job during runtime, and everything up to that point will be written to the generic log file. That's why you get two logs.&lt;/P&gt;
&lt;P&gt;A log file specified on the commandline is defined before SAS actually starts working, and will therefore contain everything in one file.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 11:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250581#M4165</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-17T11:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Add DATETIME Suffix to Schedule Program Log's</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250586#M4166</link>
      <description>&lt;P&gt;Kurt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for trying to help me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as I understand you want me to write commandline like this -&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -SYSIN "&amp;lt;path&amp;gt;\Schedule.sas" -LOG" &amp;lt;path&amp;gt;\Schedule.log"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But If I write the commandline like that how can I see the whole logs as below. I want to see the logs day to day.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1913iE7E1BA480DD45382/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Logs.png" title="Logs.png" /&gt;&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;</description>
      <pubDate>Wed, 17 Feb 2016 12:11:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250586#M4166</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-02-17T12:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Add DATETIME Suffix to Schedule Program Log's</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250591#M4167</link>
      <description>&lt;P&gt;In the Windows command processor (cmd.exe), which runs .bat files, you have access to the system environment variables.&lt;/P&gt;
&lt;P&gt;One of those is %date%, which holds the current date in your locale's format. You can use that to build the name of the log file.&lt;/P&gt;
&lt;P&gt;To manipulate the string, you can use string manipulation capabilities that are inbuilt:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.dostips.com/DtTipsStringManipulation.php" target="_self"&gt;http://www.dostips.com/DtTipsStringManipulation.php&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I STRONGLY (and I mean &lt;U&gt;&lt;STRONG&gt;STRONGLY&lt;/STRONG&gt;&lt;/U&gt;) recommend to not use the SAS-typical date format, but something like yyyy-mm-dd!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 12:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250591#M4167</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-17T12:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Add DATETIME Suffix to Schedule Program Log's</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250602#M4168</link>
      <description>&lt;P&gt;Oh thanks Kurt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems to me it will work but now I have an format problem &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; If I write "Schedule%Date%.log" into batch file because of "Wed 02/17/2016" format I get error like this -&amp;gt;"Physical file does not exist, &amp;lt;path&amp;gt;\ScheduleWed 02\17\2016.log." I think I need to get rid of the slash(/) characters and blank( ) character to get my desired output. Is there anybody who has experience on Windows command formats ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2016 15:01:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250602#M4168</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-02-21T15:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Add DATETIME Suffix to Schedule Program Log's</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250607#M4170</link>
      <description>&lt;P&gt;Use&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Schedule%date:~10,4%-%date:~7,2%-%date:~4,2%.log&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;as the logfile name.&lt;/P&gt;
&lt;P&gt;This uses the inbuilt string manipulation functions of the Windows(DOS) shell to extract year, month and day from the system date formatted in your locale's settings.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 13:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250607#M4170</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-17T13:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Add DATETIME Suffix to Schedule Program Log's</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250608#M4171</link>
      <description>&lt;P&gt;When you say "SAS Projects", do you mean Enterprise Guide projects?&lt;/P&gt;
&lt;P&gt;If your deployment have an Intelligence Server component, you could/should register your batch joibs via SAS Management&amp;nbsp;Console. By doing so, you'll get the date/time-stamp of your log files out of the box.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 13:30:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250608#M4171</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-17T13:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Add DATETIME Suffix to Schedule Program Log's</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250638#M4172</link>
      <description>&lt;P&gt;Thank you very much Kurt &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; It is working now. I think I can take the logs day to day.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 14:59:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250638#M4172</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-02-17T14:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Add DATETIME Suffix to Schedule Program Log's</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250640#M4173</link>
      <description>&lt;P&gt;LinusH,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, I meant Enterprise Guide projects.To make it clear, I will call the SAS programs and they will generate SAS datasets under the specified SAS Library.&amp;nbsp;Actually after Kurt's advises I tried in my local OS and it worked. But we need to do this process in Windows SAS Server machine. I exactly couldn't get your warning during operation. If I do this process in SAS server which road should I follow, Could you explain breifly, please ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 15:08:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250640#M4173</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-02-17T15:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Add DATETIME Suffix to Schedule Program Log's</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250666#M4179</link>
      <description>&lt;P&gt;i'd like to point out that I won't execute SAS Enterprise Guide project I will call SAS programs as below. Do I still need to consider Management Console definitions before I schedule the SAS program in SAS server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME PROG1 "&amp;lt;path&amp;gt;\Prog1.sas";
FILENAME PROG2 "&amp;lt;path&amp;gt;\Prog2.sas";
FILENAME PROG3 "&amp;lt;path&amp;gt;\Prog3.sas";


%INCLUDE PROG1 ;
%INCLUDE PROG2 ;
%INCLUDE PROG3 ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 18:21:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250666#M4179</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-02-17T18:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Add DATETIME Suffix to Schedule Program Log's</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250735#M4184</link>
      <description>If you have Management Console it's preferable to use it. &lt;BR /&gt;Register your SAS programs in SMC, then put then into a Job flow. No need to use your %include logic. The schedule manager plug in in SMC handles this and deploys the flow directly to WTS.</description>
      <pubDate>Wed, 17 Feb 2016 22:43:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/250735#M4184</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-17T22:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Add DATETIME Suffix to Schedule Program Log's</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/251403#M4232</link>
      <description>&lt;P&gt;Linush,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for these information.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2016 14:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-Add-DATETIME-Suffix-to-Schedule-Program-Log-s/m-p/251403#M4232</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-02-21T14:58:24Z</dc:date>
    </item>
  </channel>
</rss>

