<?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 Macro in SAS Log in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20053#M4142</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a quick question here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I take great effort to make my code readable, but when programs with imbedded macro programs are executed the macro code in the SAS log is all over the place.&amp;nbsp; Is there any way to retain the original format to make it more easily readable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Sep 2011 19:04:51 GMT</pubDate>
    <dc:creator>OS2Rules</dc:creator>
    <dc:date>2011-09-29T19:04:51Z</dc:date>
    <item>
      <title>Macro in SAS Log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20053#M4142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a quick question here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I take great effort to make my code readable, but when programs with imbedded macro programs are executed the macro code in the SAS log is all over the place.&amp;nbsp; Is there any way to retain the original format to make it more easily readable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 19:04:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20053#M4142</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2011-09-29T19:04:51Z</dc:date>
    </item>
    <item>
      <title>Macro in SAS Log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20054#M4143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have examples of what you mean?&lt;/P&gt;&lt;P&gt;In general the issue I have seen is that for long statements the MPRINT lines will be flowed into a single line.&amp;nbsp; Indentation is also lost.&lt;/P&gt;&lt;P&gt;Is this what you are talking about?&amp;nbsp; If so I think you are out of luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you can control are your comments.&lt;/P&gt;&lt;P&gt;When writing a macro I distinquish in my comments those that are useful when reviewing the log and those that are useful when editing or reviewing the code.&amp;nbsp; An example of the latter is and explaination of a particularly tricky piece of code or a special syntax requirement so that I don't break the code code the next time I edit it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the first type I use normal *...; comments. These will print with the code lines when MPRINT is on.&amp;nbsp; For the latter I use %*... ; comments.&amp;nbsp; I try not to use /* */ comments other than for header blocks and rarely when I need to embed a comment in the middle of a statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Placement of your comments are important.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Do not put *..; comments at the end of a line after the code because then the comment prints below the statement in the log.&lt;/P&gt;&lt;P&gt;2) Place comments for conditional blocks of code inside the conditional so that they will print only when the condition is true.&lt;/P&gt;&lt;P&gt;%if %sysfunc(exist(mydata)) %then %do;&lt;/P&gt;&lt;P&gt;* Generate summary of MYDATA;&lt;/P&gt;&lt;P&gt;proc summary data=mydata ....&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 20:26:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20054#M4143</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-09-29T20:26:37Z</dc:date>
    </item>
    <item>
      <title>Macro in SAS Log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20055#M4144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll do the best I can with the code samples....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code (just a small part of the program):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;545&amp;nbsp;&amp;nbsp;&amp;nbsp; if substr("&amp;amp;imember",11,1) = 'A' and length(account_number) ge 10 then do;&lt;/P&gt;&lt;P&gt;546&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if substr(account_number,10,1) = '-' then substr(text,14,12) = account_number;&lt;/P&gt;&lt;P&gt;547&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else do;&lt;/P&gt;&lt;P&gt;548&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(text,14,9) = substr(account_number,1,9);&lt;/P&gt;&lt;P&gt;549&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(text,23,1) = '-';&lt;/P&gt;&lt;P&gt;550&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(text,24,2) = substr(account_number,10,2);&lt;/P&gt;&lt;P&gt;551&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;552&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;553&lt;/P&gt;&lt;P&gt;554&amp;nbsp;&amp;nbsp;&amp;nbsp; if substr("&amp;amp;imember",11,1) = 'C' then do;&lt;/P&gt;&lt;P&gt;555&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(text,14,12) = account_number;&lt;/P&gt;&lt;P&gt;556&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(text,26,1) = ' ';&lt;/P&gt;&lt;P&gt;557&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(text,35,1) = ' ';&lt;/P&gt;&lt;P&gt;558&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;559&lt;/P&gt;&lt;P&gt;560&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(text,27,8) = trade_date;&lt;/P&gt;&lt;P&gt;561&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this is how my log looks (sort of):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if substr("46TR092911A.xls",11,1) = 'A' and&lt;/P&gt;&lt;P&gt;46&amp;nbsp; + length(account_number) ge 10 then do;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if substr(account_number,10,1) = '-' then substr(text,14,12) = account_number;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else do;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(text,14,9) =&lt;/P&gt;&lt;P&gt;substr(account_number,1,9);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(text,23,1) = '-';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr&lt;/P&gt;&lt;P&gt;47&amp;nbsp; +(text,24,2) = substr(account_number,10,2);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&amp;nbsp;&amp;nbsp;&amp;nbsp; if substr("46TR092911A.xls",11,1) = 'C' then do;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(text,14,12) = account_number;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(text,26,1) = ' ';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(text,35,1) = ' ';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(text,27,8&lt;/P&gt;&lt;P&gt;48&amp;nbsp; +) = trade_date;&amp;nbsp;&amp;nbsp;&amp;nbsp; transaction_type = upcase(transaction_type);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if transaction_type =: 'B' then&amp;nbsp; trans_type = '100';&amp;nbsp;&amp;nbsp; else if transaction_type =: 'S' then&amp;nbsp; trans_type = '690';&amp;nbsp;&amp;nbsp; else if&lt;/P&gt;&lt;P&gt;transaction_type =: 'E' then&amp;nbsp; trans_type = '400';&amp;nbsp;&amp;nbsp; else if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which makes it rather hard to read.&amp;nbsp; The text seems to loose all syntax.&amp;nbsp; It actually goes beyond the right side of my screen in the SAS log window.&amp;nbsp; (Here it seems to wrap within this window).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's not a big problem, but it is a pain in the backside.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 16:03:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20055#M4144</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2011-09-30T16:03:22Z</dc:date>
    </item>
    <item>
      <title>Macro in SAS Log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20056#M4145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The + signs are usually an indication of included code and not macro generation.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Normally I turn off SOURCE2 and turn on MPRINT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How are you calling the macro?&amp;nbsp; Are you using SAS/Connect so that macro is generating code that is sent to the remote session?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 16:51:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20056#M4145</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-09-30T16:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in SAS Log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20057#M4146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using CALL EXECUTE to call the macro?&lt;/P&gt;&lt;P&gt;You might try changing that to instead write code to a file and %INC the file.&amp;nbsp; Here is an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;275 %macro test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;276 data x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;277&amp;nbsp; line1='This is testing how long lines of code look';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;278&amp;nbsp; line2='This is testing how long lines of code look';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;279&amp;nbsp; line3='This is testing how long lines of code look';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;280 run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;281 %mend test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;282&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;283 data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;284&amp;nbsp;&amp;nbsp; call execute('%test');&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;285 run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;MPRINT(TEST):&amp;nbsp; data x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;MPRINT(TEST):&amp;nbsp; line1='This is testing how long lines of code look';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;MPRINT(TEST):&amp;nbsp; line2='This is testing how long lines of code look';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;MPRINT(TEST):&amp;nbsp; line3='This is testing how long lines of code look';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;MPRINT(TEST):&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;NOTE: DATA statement used (Total processtime):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;NOTE: CALL EXECUTE generated line.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;1&amp;nbsp;&amp;nbsp; +data x;&amp;nbsp; line1='This is testing how longlines of code look';&amp;nbsp; line2='This istesting how long&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;lines of code look';&amp;nbsp; line3='This is testing how long lines of codelook'; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;NOTE: The data set WORK.X has 1 observationsand 3 variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;NOTE: DATA statement used (Total processtime):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;286&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;287 filename code temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;288 data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;289&amp;nbsp;&amp;nbsp; file code;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;290&amp;nbsp;&amp;nbsp; put '%test;';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;291 run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;NOTE: The file CODE is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Filename=C:\DOCUME~1\ABERNA~1\LOCALS~1\Temp\SAS TemporaryFiles\_TD2288\#LN00010,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RECFM=V,LRECL=256,File Size (bytes)=0,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last Modified=30Sep2011:14:29:38,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create Time=30Sep2011:14:29:38&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;NOTE: 1 record was written to the file CODE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The minimum record length was 6.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The maximum record length was 6.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;NOTE: DATA statement used (Total processtime):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;292 %inc code;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;MPRINT(TEST):&amp;nbsp; data x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;MPRINT(TEST):&amp;nbsp; line1='This is testing how long lines of code look';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;MPRINT(TEST):&amp;nbsp; line2='This is testing how long lines of code look';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;MPRINT(TEST):&amp;nbsp; line3='This is testing how long lines of code look';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;MPRINT(TEST):&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;NOTE: The data set WORK.X has 1 observationsand 3 variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;NOTE: DATA statement used (Total processtime):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 18:30:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20057#M4146</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-09-30T18:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in SAS Log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20058#M4147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for the delay - going to be a busy week...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are correct - i run this code from a CALL EXECUTE.&amp;nbsp; Unfortunately, I can't change thsi because the code runs against each member of a directory&amp;nbsp; In cases when I do use the %INCLUDE, I don't have this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I usually turn off SOURCE2 as well, but I need to see what is happening during development.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2011 12:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20058#M4147</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2011-10-04T12:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in SAS Log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20059#M4148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is because SAS is expanding the macro and passing the statements onto the command stack.&amp;nbsp; You can prevent this by using %NRSTR to protect the macro call from executing at that point. Then SAS will push the macro call onto the stack and it will then execute after the current data step has finished.&amp;nbsp; There are also other timing issues that can be solved by using this technique.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example to show the difference in how the log will look.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%macro x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;* This is a macro with a few lines of code ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; x='Just to see what happens when it is invoked from ';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; y='call execute and see how it looks in the SAS log.';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;* end of macro x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%mend x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;options mprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; call execute('%x;');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; call execute('%nrstr(%%x;)');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Oct 2011 17:25:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20059#M4148</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-10-08T17:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in SAS Log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20060#M4149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you think that you cannot change it to not use CALL EXECUTE?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change a program like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; set members ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; call execute(cats('%nstr(%%mymacro)','(',memname,');'));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;to a program like this:&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;filename code temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; set members;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; file code;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; put '%mymacro(' memname ');' ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%inc code / source2 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Oct 2011 17:29:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20060#M4149</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-10-08T17:29:04Z</dc:date>
    </item>
    <item>
      <title>Macro in SAS Log</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20061#M4150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for a development stage, assign fileref mprint to a writeable file and switch on options MPRINT and MFILE. Then re-run your process. The option MFILE passes code generated by macros to the mprint file. &lt;/P&gt;&lt;P&gt;In enterprise guide 4.3 open that mprint file into a code window and "format code" the keyboard equivalent is CTRL+i&lt;/P&gt;&lt;P&gt;It will not be the original source, but will be readable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 15:30:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Macro-in-SAS-Log/m-p/20061#M4150</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-10-11T15:30:06Z</dc:date>
    </item>
  </channel>
</rss>

