Dear community, I have created the following picture format so that the numbers in cross tables are decimal-point aligned when monospace style is used: proc format;
picture pctn
low - <10 = "0009.9%)" (prefix="( ")
10 - <100 = "0099.9%)" (prefix="( ")
100 - high = "0999.9%)" (prefix="("); 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: %macro replay_table(file, object, title);
proc document name=foolib.&file;
obstitle &object "%bquote(&title)" /just=left;
replay &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 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.
... View more