<?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 Proc Printto Logging Options in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78556#M3526</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to use the same type of logging options in code as it is when setting the log at the command line? I would like ensure that I have unique log names as my stored process is called frequencies and I have had problems in the past. I know I could create a new variable which I could append to the proc printto log= statement but it would be more convenient to use similar options. Below is a link to the documentation which shows the command line options, precisely the "Details" section.. &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002303556.htm" title="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002303556.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002303556.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; p&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Jun 2012 03:17:06 GMT</pubDate>
    <dc:creator>bream_bn</dc:creator>
    <dc:date>2012-06-08T03:17:06Z</dc:date>
    <item>
      <title>Proc Printto Logging Options</title>
      <link>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78556#M3526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to use the same type of logging options in code as it is when setting the log at the command line? I would like ensure that I have unique log names as my stored process is called frequencies and I have had problems in the past. I know I could create a new variable which I could append to the proc printto log= statement but it would be more convenient to use similar options. Below is a link to the documentation which shows the command line options, precisely the "Details" section.. &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002303556.htm" title="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002303556.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002303556.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; p&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2012 03:17:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78556#M3526</guid>
      <dc:creator>bream_bn</dc:creator>
      <dc:date>2012-06-08T03:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Printto Logging Options</title>
      <link>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78557#M3527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you asking how to generate a filename that reflects the current time?&lt;/P&gt;&lt;P&gt;%let ts=%sysfunc(today(),yymmddn8.);&lt;/P&gt;&lt;P&gt;proc printto log="myfile&amp;amp;ts..log";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use &amp;amp;SYSDATE9 and &amp;amp;SYSTIME to get the date and time that the SAS session started or use TODAY(),TIME() or DATETIME() to get the current time.&amp;nbsp; You can use formats or string manipulation to pull out whatever parts of the name you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I find that when creating filenames using dates it is best to use YYMMDD formats because then the filenames will sort naturally into date order.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jun 2012 15:27:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78557#M3527</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-06-09T15:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Printto Logging Options</title>
      <link>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78558#M3528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I agree with Tom.&amp;nbsp; Recently I've been doing date-times with the b8601dt format, which returns yyyymmddThhmmss.&amp;nbsp; (e.g. 20120611T083038 for 8:30 am on June 11 2012.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm still new to stored processes. I've been playing with using &amp;amp;_prorgram and &amp;amp;_Username in the name of the file as well, and dumping all my stored process logs in one folder.&amp;nbsp; One caveat is that I think &amp;amp;_username may be a generic value if user is not defined in metadata.&amp;nbsp; Also been thinking about having a standard put statement at the stop of every stored process to write key values to the log (e.g. all user-specified parameters, maybe even just all macro variables).&amp;nbsp; So that later can parse logs to looks for trends in how users invoke different stored processes.&amp;nbsp; Or maybe just append these values to a dataset every time a stored process is invoked....&lt;/P&gt;&lt;PRE&gt;filename logfile "/logs/%sysfunc(compress(%scan(&amp;amp;_program,-1,/)_&amp;amp;_UserName._%sysfunc(datetime(),b8601dt))).log";
proc printto log=logfile new;
run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Q.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2012 12:39:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78558#M3528</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2012-06-11T12:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Printto Logging Options</title>
      <link>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78559#M3529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have our Stored Process setup as Web Services, these services can get called concurrently by different users and so I was hoping to be able to use the %v option to give each log name a unique name every time. I use a form of the date time currently but I do like the way the b8601dt format displays and will likely to begin using that to make my log names unique. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2012 14:47:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78559#M3529</guid>
      <dc:creator>bream_bn</dc:creator>
      <dc:date>2012-06-11T14:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Printto Logging Options</title>
      <link>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78560#M3530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you SAS process is running on Unix and you can call system commands then look at the mktemp command.&amp;nbsp; That should let you generate a unique filename.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2012 15:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78560#M3530</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-06-11T15:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Printto Logging Options</title>
      <link>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78561#M3531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your SAS process is running on Unix and you can call system commands then look at the mktemp command.&amp;nbsp; That should let you generate a unique filename.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2012 15:31:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78561#M3531</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-06-11T15:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Printto Logging Options</title>
      <link>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78562#M3532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the info I will look into the mktemp command as an alternative. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 14:47:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Proc-Printto-Logging-Options/m-p/78562#M3532</guid>
      <dc:creator>bream_bn</dc:creator>
      <dc:date>2012-06-12T14:47:20Z</dc:date>
    </item>
  </channel>
</rss>

