BookmarkSubscribeRSS Feed
tobriain
Calcite | Level 5


Hi,


I'm running a 'proc means' command to print out summary stats on two

variables below: stakeVO and payoutVO. I'm creating latex on-the-fly

and picking the latex up in a larger document with the appropriate

headers for the table and all that. It works perfectly if I have only

one variable in the 'var' part of the PROC MEANS command. I can even

have a number of class statements there and it works. However, if I

add another variable to the 'var' statement, there is a carriage

return missing from the latex output.

This is the output I'm getting:

stakeVO    & 48.05    & 10.00    & 192.10    & 0.01    & 24000.00    &

payoutVO    & -1.96    & 0.14    & 170.02    & -24000.00    & 10002.78

  \tabularnewline

This is the output I want:

stakeVO    & 48.05    & 10.00    & 192.10    & 0.01    & 24000.00

\tabularnewline

payoutVO    & -1.96    & 0.14    & 170.02    & -24000.00    & 10002.78

  \tabularnewline

I'm using the following sas command to create the table (which does

display perfectly in the SAS results viewer).

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;

I've tried using all the original tagsets for latex output i.e. Latex,

SimpleLatex and TablesOnlyLatex, but it still doesn't print an

end-of-line character.

This is the contents of my customer tagset:

*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;

quit;


I'd appreciate any help at all on this.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 1119 views
  • 0 likes
  • 1 in conversation