<?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: The Use of Submit-Endsubmit with Proc Printto? in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/The-Use-of-Submit-Endsubmit-with-Proc-Printto/m-p/419517#M3887</link>
    <description>&lt;P&gt;Your example works on SAS 9.4M5 (Windows) and creates the file Noname.txt in the current working directory.&lt;/P&gt;
&lt;P&gt;1. What version of SAS are you running?&lt;/P&gt;
&lt;P&gt;2. What operating system?&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp;What interface to SAS are you using (DMS, EG, or SAS Studio)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are running an old version of SAS, I might have a hunch. Run the following program. Do you get the same behavior or does it work as expected?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
submit;
   proc printto log="Noname.txt";
   run;
endsubmit;

	do IMLVariable=1 to 30;
		submit IMLVariable;
			%put IMLVariable=&amp;amp;IMLVariable;
		endsubmit;
	end;

submit;
   proc printto;
   run;
endsubmit;

quit&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 08 Dec 2017 10:38:44 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2017-12-08T10:38:44Z</dc:date>
    <item>
      <title>The Use of Submit-Endsubmit with Proc Printto?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/The-Use-of-Submit-Endsubmit-with-Proc-Printto/m-p/419466#M3886</link>
      <description>&lt;P&gt;Hi, I found&amp;nbsp;the submit-endsubmit method does not work in this case.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;resetline;
ods html close;
ods graphics off;
ods listing;

proc printto log="Noname.txt";
run;

proc iml;
	do IMLVariable=1 to 30;
		submit IMLVariable;
			%put IMLVariable=&amp;amp;IMLVariable;
		endsubmit;
	end;
quit;

proc printto;
run;

quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I&amp;nbsp;thought&amp;nbsp;the iterations would be recorded in Noname.txt, but in this case SAS displays&amp;nbsp;the iterations using SAS Message Log instead.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 412px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17087i38C194E7D43EDA78/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks in&amp;nbsp;advance.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 03:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/The-Use-of-Submit-Endsubmit-with-Proc-Printto/m-p/419466#M3886</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2017-12-08T03:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: The Use of Submit-Endsubmit with Proc Printto?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/The-Use-of-Submit-Endsubmit-with-Proc-Printto/m-p/419517#M3887</link>
      <description>&lt;P&gt;Your example works on SAS 9.4M5 (Windows) and creates the file Noname.txt in the current working directory.&lt;/P&gt;
&lt;P&gt;1. What version of SAS are you running?&lt;/P&gt;
&lt;P&gt;2. What operating system?&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp;What interface to SAS are you using (DMS, EG, or SAS Studio)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are running an old version of SAS, I might have a hunch. Run the following program. Do you get the same behavior or does it work as expected?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
submit;
   proc printto log="Noname.txt";
   run;
endsubmit;

	do IMLVariable=1 to 30;
		submit IMLVariable;
			%put IMLVariable=&amp;amp;IMLVariable;
		endsubmit;
	end;

submit;
   proc printto;
   run;
endsubmit;

quit&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Dec 2017 10:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/The-Use-of-Submit-Endsubmit-with-Proc-Printto/m-p/419517#M3887</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-12-08T10:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: The Use of Submit-Endsubmit with Proc Printto?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/The-Use-of-Submit-Endsubmit-with-Proc-Printto/m-p/419641#M3891</link>
      <description>&lt;P&gt;Thanks Rick. It seems it is TS1M1 as you mentioned. What you provided is marginally different from what I expected since I cannot use this way with other procedures together.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;resetline;
ods html close;
ods graphics off;
ods listing;

proc printto log="Noname.txt";
run;

data DataSet;
	do Variable=1 to 10;
		put Variable;
	end;
run;

proc printto;
run;

proc iml;
	submit;
		proc printto log="Noname.txt";
		run;
		%put Turn on PROC PRINTTO;
	endsubmit;
	do IMLVariable=1 to 30;
		submit IMLVariable;
			%put IMLVariable=&amp;amp;IMLVariable;
		endsubmit;
	end;
	submit;
		%put Turn off PROC PRINTTO;
		proc printto;
		run;
	endsubmit;
quit;

proc printto log="Noname.txt";
run;

data DataSet;
	do Variable=1 to 10;
		put Variable;
	end;
run;

proc printto;
run;

quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I must turn off and on&amp;nbsp;printto procedures right before and after IML procedures.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 17:47:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/The-Use-of-Submit-Endsubmit-with-Proc-Printto/m-p/419641#M3891</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2017-12-08T17:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: The Use of Submit-Endsubmit with Proc Printto?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/The-Use-of-Submit-Endsubmit-with-Proc-Printto/m-p/419664#M3892</link>
      <description>&lt;P&gt;I'm glad it works. Lucky guess on my part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Two questions:&lt;/P&gt;
&lt;P&gt;1. Why are you doing this? Is it because you are running a macro that calls many procedures that are filling up the log? If so, there might be &lt;A href="https://blogs.sas.com/content/iml/2012/07/18/simulation-in-sas-the-slow-way-or-the-by-way.html" target="_self"&gt;a better way to program your task which is more efficient.&lt;/A&gt;&amp;nbsp;You can also &lt;A href="https://blogs.sas.com/content/iml/2013/05/24/turn-off-ods-for-simulations.html" target="_self"&gt;use ODS OUTPUT to supress&amp;nbsp;output.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;2. Since the default for PROC PRINTTO is to append, can't you just&amp;nbsp;call PROC PRINTTO three times: 1. at the top of your program/macro, 2. inside PROC IML, and 3. at the end of your program/macro.&amp;nbsp; I don't understand why you need to switch back and forth between the log and the LISTING.&amp;nbsp; If you are trying to capture part of the output, you can &lt;A href="https://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html" target="_self"&gt;use ODS OUTPUT to capture the tables you want as SAS data sets.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this is part of a simulation study, you might want to view &lt;A href="https://blogs.sas.com/content/iml/2015/08/24/ten-tips-simulating-data.html" target="_self"&gt;"Video: Ten tips for simulating data with SAS"&lt;/A&gt;&amp;nbsp;or read the associated paper.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 18:50:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/The-Use-of-Submit-Endsubmit-with-Proc-Printto/m-p/419664#M3892</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-12-08T18:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: The Use of Submit-Endsubmit with Proc Printto?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/The-Use-of-Submit-Endsubmit-with-Proc-Printto/m-p/419716#M3893</link>
      <description>&lt;P&gt;For 2, I need to go back and forth indeed because SAS cannot access to Noname.txt otherwise.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 412px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17110iAF1B9040268C67BA/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I saw this when I tried yours. I will check your other posts, thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 21:44:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/The-Use-of-Submit-Endsubmit-with-Proc-Printto/m-p/419716#M3893</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2017-12-08T21:44:07Z</dc:date>
    </item>
  </channel>
</rss>

