首页 文章

SAS:ODS LATEX标签省略了LINE ENDING MARK

提问于
浏览
1

我正在运行'proc means'命令打印下面两个变量的汇总统计信息:var1和var2 . 我正在动态创建乳胶,并在一个更大的文档中选择乳胶,并为表格提供适当的 Headers . 如果我在PROC MEANS命令的'var'部分只有一个变量,它的工作正常 . 我甚至可以在那里有一些类声明,它的工作原理 . 但是,如果我在'var'语句中添加另一个变量,则乳胶输出中会缺少回车符 .

这是我得到的输出:

var1    & 1.0    & 1.0    & 1.0    & 1.0    & 1.0    & 
var2 & 1.0    & 1.0    & 1.0    & -1.0.00    & 1.0   \tabularnewline

这是我想要的输出:

var1 & 1.0    & 1.0    & 1.0    & 1.0    & 1.0     \tabularnewline
var2 & 1.0    & 1.0    & 1.0    & 1.0    & 1.0   \tabularnewline

我正在使用以下sas命令来创建表(它在SAS结果查看器中完美显示) .

ods tagsets.customMinimal file="summaryPanelA_data.tex" (notop nobot) newfile=table;
proc means data=phd.formatted mean median stddev min max maxdec=2;
var stake payout;
run;
ods tagsets.customMinimal close;

我已经尝试将所有原始标签集用于乳胶输出,即Latex,SimpleLatex和TablesOnlyLatex,但它仍然不会打印行尾字符 .

这是我的客户标签集的内容:

*START REGION: Running this creates a new template;
Proc template;
define tagset Tagsets.customMinimal;
define event byline;end;
define event proc_title;end;
define event note;end;
define event Error;end;
define event Warn;end;
define event Fatal;end;
define event system_footer;end;
define event leaf;end;
define event proc_branch;end;
define event branch;end;
define event pagebreak;end;
define event system_title;end;
define event table;end;
define event table_head;end;
define event colspecs;end;
define event colspec_entry;end;
define event row;

        break /if ^contains( $HTMLCLASS, "data");
        put "                " NL "  " /if ^exists( $colspan);
    finish:     
        break /if cmp( $sascaption, "true");
        break /if contains( HTMLCLASS, "data");
        break /if ^exists($hasdata);
        put "\tabularnewline" NL /if ^exists( $colspan);
        unset $hasdata;
end;

define event data;
    start:
        put VALUE /if cmp( $sascaption, "true");

        break /if cmp( $sascaption, "true");
        break /if ^contains( HTMLCLASS, "data");
        break /if exists( $colspan) | exists ( $cell_align );

        put %nrstr(" & ") /if ^cmp( COLSTART, "1");

        unset $colspan;
        set $colspan colspan;     
        set $hasdata '1';    

        /*put tranwrd(VALUE,"-","$-$") /if contains( HTMLCLASS, "data"); */
        put tranwrd(VALUE,"-","-") /if contains( HTMLCLASS, "data");
        put VALUE /if ^contains( HTMLCLASS, "data");
        put "   ";

    finish:
        break /if ^contains( HTMLCLASS, "data");
        break /if cmp( $sascaption, "true");
        break /if exists( $colspan) | exists ( $cell_align );
end;

parent = tagsets.simplelatex;
end;

放弃;

1 回答

  • 1

    我相信这是PROC MEANS ODS模板的一个问题 . 如果你有9.3,你可以使用 STACKODSOUTPUT 选项(见the documentation),但对于9.2或更早版本,我不相信有一个简单的解决方案 . 在这种情况下,你最好的选择可能是将PROC MEANS输出到数据集,操作它,然后PROC PRINT到你的LaTeX解决方案 .

相关问题