<?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: Format Output Results for PROC IML Print Statement in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/556009#M4667</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;Thank you for sharing this.&lt;/P&gt;</description>
    <pubDate>Fri, 03 May 2019 17:03:38 GMT</pubDate>
    <dc:creator>publicSynechism</dc:creator>
    <dc:date>2019-05-03T17:03:38Z</dc:date>
    <item>
      <title>Format Output Results for PROC IML Print Statement</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/555756#M4660</link>
      <description>&lt;P&gt;I'm running this code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* show dataset info;
proc iml;
use sashelp.class;
show contents;
quit;

* show dataset missing;
proc iml;
use sashelp.class;
read all var _NUM_ into x[colname=nNames];
n = countn(x,"col");
nmiss = countmiss(x,"col");
ntotal = n + nmiss;
n_p = (n / ntotal) * 100;
nmiss_p = (nmiss / ntotal) * 100;

read all var _CHAR_ into x[colname=cNames];
c = countn(x,"col");
cmiss = countmiss(x,"col");
ctotal = c + cmiss;
c_p = (c / ctotal) * 100;
cmiss_p = (cmiss / ctotal) * 100;
close data.stl_2p;

Names = cNames || nNames;
colNames = {"Missing", "Not Missing"};
cnt = (cmiss_p // c_p) || (nmiss_p // n_p);
cnt = cnt`;
print cnt[r=Names c=colNames label="Percent(%)" format=5.2];
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The output for "show contents" can be pasted nicely into comments, but the "print ..." table cannot.&lt;/P&gt;&lt;P&gt;Is there a way to format the results of the print statement to be similar to "show contents"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just want the table values to be aligned with the columns when I copy paste it into the comments.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 20:35:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/555756#M4660</guid>
      <dc:creator>publicSynechism</dc:creator>
      <dc:date>2019-05-02T20:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Format Output Results for PROC IML Print Statement</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/555758#M4661</link>
      <description>Can I ask why you're using IML here instead of PROC FREQ or TABULATE with a more controlled output format?</description>
      <pubDate>Thu, 02 May 2019 20:44:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/555758#M4661</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-02T20:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Format Output Results for PROC IML Print Statement</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/555763#M4662</link>
      <description>&lt;P&gt;I normally use&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
	value $missfmt ' '='Missing' other='Not Missing';
	value  missfmt  . ='Missing' other='Not Missing';
run;

proc freq data=sashelp.class;
format _NUMERIC_ missfmt.;
table _NUMERIC_ / missing;
format _CHAR_ $missfmt.;
table _CHAR_ / missing;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But I wanted to keep all values in a single table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there is an easier method that does exactly this, then I'd like to use that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, my main problem is just getting a nicely aligned table that can be copy pasted back into the editor without first writing to another file.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 20:58:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/555763#M4662</guid>
      <dc:creator>publicSynechism</dc:creator>
      <dc:date>2019-05-02T20:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Format Output Results for PROC IML Print Statement</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/555813#M4663</link>
      <description>&lt;P&gt;I have a version here if you’d like that collects all the info cleanly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/2de1faf1644dc8160fe721056202f111" target="_blank"&gt;https://gist.github.com/statgeek/2de1faf1644dc8160fe721056202f111&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 00:04:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/555813#M4663</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-03T00:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Format Output Results for PROC IML Print Statement</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/555942#M4664</link>
      <description>&lt;P&gt;Why not post it at IML forum ?&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp; is there .&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 14:39:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/555942#M4664</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-05-03T14:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Format Output Results for PROC IML Print Statement</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/555962#M4665</link>
      <description>&lt;P&gt;Sure. you are probably copying from the HTML destination. You can preserve spacing by copying from the LISTING destination, which uses a monospace (fixed-width) font.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods listing;&lt;BR /&gt;print cnt[r=Names c=colNames label="Percent(%)" format=5.2];&lt;BR /&gt;ods listing close;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can now copy/paste the results from the Output window. If you can't find the Output window, tell us how you are running the code: SAS Studio? Enterprise Guide? Classic Windowing system (DMS)?&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 15:10:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/555962#M4665</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-05-03T15:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Format Output Results for PROC IML Print Statement</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/556009#M4667</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;Thank you for sharing this.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 17:03:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/556009#M4667</guid>
      <dc:creator>publicSynechism</dc:creator>
      <dc:date>2019-05-03T17:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Format Output Results for PROC IML Print Statement</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/556011#M4669</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;This output exactly what I was looking for. Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 17:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Format-Output-Results-for-PROC-IML-Print-Statement/m-p/556011#M4669</guid>
      <dc:creator>publicSynechism</dc:creator>
      <dc:date>2019-05-03T17:05:07Z</dc:date>
    </item>
  </channel>
</rss>

