<?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>peterprec Tracker</title>
    <link>https://communities.sas.com/kntur85557/tracker</link>
    <description>peterprec Tracker</description>
    <pubDate>Sun, 19 Apr 2026 06:29:44 GMT</pubDate>
    <dc:date>2026-04-19T06:29:44Z</dc:date>
    <item>
      <title>Re: Severe penalty for using MFILE?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926616#M364640</link>
      <description>&lt;P&gt;Looking at&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;'s code, I think it should be quadratic as you have 2 %do-loops with the same counter inside each other. Nice to see that theory and reality aligns. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; And it still confirms the rather large penalty for using MFILE...&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/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;: Do you know something about the inner workings of the MFILE?&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 14:08:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926616#M364640</guid>
      <dc:creator>peterprec</dc:creator>
      <dc:date>2024-05-01T14:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Severe penalty for using MFILE?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926591#M364627</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;- grid, sounds sick! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Perhaps you can run this a well:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%macro genCode(genlineOfCode);
    %if %nrbquote(&amp;amp;genlineOfCode)=%nrbquote() %then %let genlineOfCode=100;

    data _null_;
        %do i=1 %to &amp;amp;genlineOfCode;
            a=&amp;amp;i;
        %end;
    run;

%mend;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Would be interesting to see - and I'm still a little baffled why you don't see much penalty with the data _null_ code when both myself and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;does... Any ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 08:28:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926591#M364627</guid>
      <dc:creator>peterprec</dc:creator>
      <dc:date>2024-05-01T08:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Severe penalty for using MFILE?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926585#M364625</link>
      <description>&lt;P&gt;I've now managed to run both test scripts, and their variations, on both SODA and in my work enviroment (SAS server, windows) and in all cases I can replicate the results shown in this thread.&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 06:37:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926585#M364625</guid>
      <dc:creator>peterprec</dc:creator>
      <dc:date>2024-05-01T06:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Severe penalty for using MFILE?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926506#M364596</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;- good stuff! Your results baffled me...&lt;/P&gt;&lt;P&gt;So, however, I made the use case just a little different and only slightly more complicated:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%macro genCode(genlineOfCode);
    %if %nrbquote(&amp;amp;genlineOfCode)=%nrbquote() %then
        %let genlineOfCode=100;

    data _null_;
        %do i=1 %to &amp;amp;genlineOfCode;
            a=&amp;amp;i;
        %end;
    run;

%mend;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and then I get this (SODA environment):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snip.png" style="width: 628px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96060iC563903D0C428902/image-size/large?v=v2&amp;amp;px=999" role="button" title="snip.png" alt="snip.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So, to me, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;, it still looks like the MFILE is not behaving according to intention? Disagree? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 17:45:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926506#M364596</guid>
      <dc:creator>peterprec</dc:creator>
      <dc:date>2024-04-30T17:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Severe penalty for using MFILE?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926448#M364571</link>
      <description>&lt;P&gt;Great post,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;! It completely confirms my observations. It aligns poorly with cause being the MFILE target written to a slow location, but supports that something in the MFILE implementations does not work as intended. Completely guessing here, it almost feels like MFILE writes one resolved programming statement/token at a time to disk (i.e., no buffering at all) while the rest of the execution sits and waits for the MFILE I/O to finish.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 12:11:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926448#M364571</guid>
      <dc:creator>peterprec</dc:creator>
      <dc:date>2024-04-30T12:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Severe penalty for using MFILE?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926410#M364560</link>
      <description>&lt;P&gt;Thanks for the nice comment! I tried using RUN CANCEL in the script, however, it had no effect on execution time. I also used CALL EXECUTE and it does require a fair bit of rewriting the script because of the way it works compared to dosubl(), but the results were the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sending the MFILE target to work doesn't change performance compared to TEMP - the two locations are also very much "neighbors"...&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 04:33:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926410#M364560</guid>
      <dc:creator>peterprec</dc:creator>
      <dc:date>2024-04-30T04:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Severe penalty for using MFILE?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926408#M364558</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp;for taking your time to reply. Really appreciate it. I see your points and making sure you write to a fast location makes absolute sense. Supporting that is the observation that shifting the MFILE target, via the FILENAME statement, to DUMMY from TEMP removes any performance difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, as a layman not knowing too much about the behind-the-scenes-stuff… I'm not buying it. &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt; I think there is a problem with the MFILE implementation. Reason being, that if I run this script in my work environment in batch, having set the location of the MFILE file to the exact same folder location as the .log file, you still see huge differences. And we must bear in mind that SAS, because of the MPRINT, writes character for character the exact same content to the log and to the MFILE target. But enabling MFILE, as the only difference, slows the process down enormously. And to me, that behavior make no sense, and I doubt that is the intention of the MFILE implementation.&lt;BR /&gt;I have also placed the MFILE target in WORK, but the performance is exactly the same as with using TEMP on FILENAME. That is expected, I guess, as the TEMP location points basically to the same location as WORK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested in SODA to see whether what I observed in my work environment was linked to the setup at work or not. The results points to that it wasn’t but rather it points to the MFILE implementation being the culprit. Note: As a whole the SODA setup is so much faster than SAS at work, niiice, and less impacted by MFILE. I had hoped raising a ticket in the SODA environment would have been taken a bit better care of, but I’ll now make sure to push it through the work channels as well.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 04:35:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926408#M364558</guid>
      <dc:creator>peterprec</dc:creator>
      <dc:date>2024-04-30T04:35:02Z</dc:date>
    </item>
    <item>
      <title>Severe penalty for using MFILE?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926369#M364542</link>
      <description>&lt;P&gt;I’ve noticed that when enabling the MFILE option, which is very handy in many situations ranging from debugging to producing production-ready programs, program execution time is severely impacted. Much more than the simple I/O operation of writing the MPRINT statements already being written to the program log would suggest. Depending on the complexity and amount of macro code to be resolved, this may cause the execution to take 5-7 times longer. And to be precise, I am only referring to adding the MFILE option on top of the MPRINT. I’ve coded a simple example in which the performance within SODA is ~2.5 times slower. I’ve noticed this behavior in the past, in local DM, SAS server, SAS EG, etc. applications., in Windows environments etc. It seems like a global issue with the MFILE implementation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To investigate, I’ve also played around with the FILENAME statement (in which the MPRINT fileref is set) but it seems to have little impact.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a snip of the proc print and means output&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snip.png" style="width: 427px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96016iC77DC2EE1E2DF438/image-size/large?v=v2&amp;amp;px=999" role="button" title="snip.png" alt="snip.png" /&gt;&lt;/span&gt;&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/4539"&gt;@Sas&lt;/a&gt; technical support? Anyone has any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code used to test:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%macro test;
    %do i=1 %to 250;

        data t&amp;amp;i.;
            %do j=1 %to 100;

                do k&amp;amp;j.=1 to 5;
                    output;
                end;
            %end;
        run;

    %end;

    %do i=1 %to 250;

        data t&amp;amp;i.;
            %do j=1 %to 100;

                do k&amp;amp;j.=1 to 5;
                    output;
                end;
            %end;
        run;

    %end;
%mend;

%macro wmfile;
    filename mprint temp;
    options mprint mfile;
    %test;
    options nomfile;
%mend;

%macro womfile;
    options mprint nomfile;
    %test;
%mend;

data bench;
    length onbench $200;

    do run=1 to 3;
        do onbench='%wmfile', '%womfile';
            start=time();
            rc=dosubl(onbench);
            end=time();
            mark=end-start;
            output;
        end;
    end;
run;

proc print data=bench;
run;

proc means data=bench;
    class onbench;
    var mark;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;20 year SAS user, but first post here. Thanks for your time.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 18:04:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Severe-penalty-for-using-MFILE/m-p/926369#M364542</guid>
      <dc:creator>peterprec</dc:creator>
      <dc:date>2024-04-29T18:04:06Z</dc:date>
    </item>
  </channel>
</rss>

