<?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: replaying reports using proc document mangles picture format in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/546906#M22588</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes, the format is being output. The following two lines:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Format PCTN is already on the library WORK.FORMATS.
NOTE: Format PCTN has been output.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;are repeated for every replay_table macro invocation. What is being strange here is that both brackets and the percent sign are being used as defined in the pctn format, it is only the rounding and prefix which are being lost.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Mar 2019 14:17:05 GMT</pubDate>
    <dc:creator>js5</dc:creator>
    <dc:date>2019-03-28T14:17:05Z</dc:date>
    <item>
      <title>replaying reports using proc document mangles picture format</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/546866#M22585</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created the following picture format so that the numbers in cross tables are decimal-point aligned when monospace style is used:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
	picture pctn
		low - &amp;lt;10	= "0009.9%)" (prefix="(  ")
		10  - &amp;lt;100	= "0099.9%)" (prefix="( ")
		100 - high	= "0999.9%)" (prefix="(");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Interestingly enough, this only works when outputting the reports from proc tabulate directly into ods rtf. When I am trying to store the documents in ods document and concatenate them later using proc document, the pctn format is getting mangled and the prefix disappears. I am using the following macro to join the documents:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro replay_table(file, object, title);

	proc document name=foolib.&amp;amp;file;
		obstitle &amp;amp;object "%bquote(&amp;amp;title)" /just=left;
		replay &amp;amp;object;
	quit;

%mend replay_table;

%macro generate_onedoc;

	data _null_;
		toc = cats("'", pathname("foolib"), "\table_of_contents.csv'");
		rtfout = cats("'", pathname("foolib"), "\single_file_output.rtf'");
		call execute(catx(" ", "filename toc", toc, ";"));
		call execute(cats(" ", "ods rtf style=monospace bodytitle file=", rtfout, ";"));
	run;

	data _null_;
		infile toc firstobs=2 dsd dlm=";" truncover;
		length file $6 object $28 title $250;
		input file object title;
		call execute(cats('%replay_table(', file, ',', object, ', %str(', title,'))'));
	run;

	ods rtf close;
%mend generate_onedoc;

%generate_onedoc&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any ideas what might be happening here? Looking at the logs it appears that proc document is implicitly running proc format, but I am not sure if this is the reason for the strange behaviour.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 12:15:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/546866#M22585</guid>
      <dc:creator>js5</dc:creator>
      <dc:date>2019-03-28T12:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: replaying reports using proc document mangles picture format</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/546888#M22586</link>
      <description>&lt;P&gt;I have now updated my format to use round option:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
	picture pctn (round)
		low - &amp;lt;10	= "0009.9%)" (prefix="(  ")
		10  - &amp;lt;100	= "0099.9%)" (prefix="( ")
		100 - high	= "0999.9%)" (prefix="(");S&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Similarly to the prefix it is getting ignored when output is produced using proc document. Is proc document having issues with brackets?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 13:24:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/546888#M22586</guid>
      <dc:creator>js5</dc:creator>
      <dc:date>2019-03-28T13:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: replaying reports using proc document mangles picture format</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/546900#M22587</link>
      <description>&lt;P&gt;Is the format PCTN available when you replay.&amp;nbsp; Do you get a NOTE: about the format being output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/28292iE7C2F20FE91864D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 13:44:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/546900#M22587</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-03-28T13:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: replaying reports using proc document mangles picture format</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/546906#M22588</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes, the format is being output. The following two lines:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Format PCTN is already on the library WORK.FORMATS.
NOTE: Format PCTN has been output.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;are repeated for every replay_table macro invocation. What is being strange here is that both brackets and the percent sign are being used as defined in the pctn format, it is only the rounding and prefix which are being lost.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 14:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/546906#M22588</guid>
      <dc:creator>js5</dc:creator>
      <dc:date>2019-03-28T14:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: replaying reports using proc document mangles picture format</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/546926#M22589</link>
      <description>&lt;P&gt;I was able to generate a reproducer for the missing spaces using the sashelp.cars dataset:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
	picture pctn (round)
		low - &amp;lt;10	= "0009.9%)" (prefix="(  ")
		10  - &amp;lt;100	= "0099.9%)" (prefix="( ")
		100 - high	= "0999.9%)" (prefix="(");
quit;

ods pdf file="c:\Users\&amp;amp;sysuserid\Downloads\proctab_direct.pdf" style=monospace;
ods document name=indirect(write);

proc tabulate data=sashelp.cars;
	var Cylinders;
	class Make Type;

	table Make all, Type * Cylinders * (sum * [style=[just=R borderrightstyle=hidden cellwidth=50] format=best3.] colpctsum * [style=[just=L borderleftstyle=hidden cellwidth=90] format=pctn.]);
quit;

ods document close;
ods pdf close;
ods pdf file="c:\Users\&amp;amp;sysuserid\Downloads\proctab_indirect.pdf" style=monospace;

proc document name=indirect;
	replay \Tabulate#1\Report#1\Table#1;
quit;

ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The rounding vs truncation issue does not appear to be happening here though.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 15:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/546926#M22589</guid>
      <dc:creator>js5</dc:creator>
      <dc:date>2019-03-28T15:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: replaying reports using proc document mangles picture format</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/546953#M22590</link>
      <description>&lt;P&gt;I got it to work using a permanent format.&amp;nbsp; PROC DOCUMENT does not store permanent formats and does not recreate them so they can't be corrupted.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets kill;
   quit;

libname library "%sysfunc(pathname(work,L))";

proc format lib=library.fmt;
	picture pctn (round)
		low - &amp;lt;10	= "0009.9%)" (prefix="(  ")
		10  - &amp;lt;100	= "0099.9%)" (prefix="( ")
		100 - high	= "0999.9%)" (prefix="(");
quit;
options fmtsearch=(library.fmt);
ods pdf file=".\xproctab_direct.pdf" style=monospace;

ods document name=indirect(write);
proc tabulate data=sashelp.cars;
	var Cylinders;
	class Make Type;
   table Make all, Type * Cylinders * (sum * [style=[just=R borderrightstyle=hidden cellwidth=50] format=best3.] colpctsum * [style=[just=L borderleftstyle=hidden cellwidth=90] format=pctn.]);
   quit;

ods document close;
ods pdf close;
ods pdf file=".\xproctab_indirect.pdf" style=monospace;
proc document name=indirect;
	replay \Tabulate#1\Report#1\Table#1;
   quit;
ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/28297i6A2B77CB1DE9F03E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 16:57:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/546953#M22590</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-03-28T16:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: replaying reports using proc document mangles picture format</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/547122#M22591</link>
      <description>&lt;P&gt;Thank you, it worked! I was still having some issues with one of the ods documents using update mode - it was breaking all documents after itself), but switching the offender to write mode has allowed to replay all documents without issues.&lt;/P&gt;&lt;P&gt;It is still strange that using a permanent format is required though.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 08:06:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/replaying-reports-using-proc-document-mangles-picture-format/m-p/547122#M22591</guid>
      <dc:creator>js5</dc:creator>
      <dc:date>2019-03-29T08:06:35Z</dc:date>
    </item>
  </channel>
</rss>

