Help using Base SAS procedures

Ods tagsets.excelxp style: justify the categories of a variable

Reply
Contributor
Posts: 23

Ods tagsets.excelxp style: justify the categories of a variable

Dear experts,

when I use Ods tagsets.excelxp and proc tabulate, I don't succeed in justifying the categories of the variable in the heading columns: when I add "/style={just=r}" besides the class variable in the heading, sas justifies only the name of the variable, and not its categories:

ods tagsets.excelxp path="C:\Tables" file="table1.xml";

ods tagsets.excelxp options (sheet_interval="table");

ods tagsets.excelxp options (sheet_name="table 1");

     proc tabulate data=sashelp.class;

     CLASS sex /style={just=r};

     CLASS age height weight;

     TABLE age,sex*(n=''*F=9.)/rts=40;

     run;

ods _all_ close;

Is there a way to justify categories?

Thank you,

Daniela

SAS Super FREQ
Posts: 8,866

Re: Ods tagsets.excelxp style: justify the categories of a variable

Posted in reply to Daniela_P

Hi:

  But the CLASS statement only impacts the header cell with the variable name or label. That is how TABULATE is designed. Look up the CLASSLEV statement in the documentation for TABULATE. If you want to have a style impact on the VALUES for the CLASS variable, then you need the CLASSLEV statement too.

cynthia

New Contributor
Posts: 2

Re: Ods tagsets.excelxp style: justify the categories of a variable

Posted in reply to Daniela_P

Hi Cynthia,

using DDE in PC SAS windows environment generating report to Excel with rows & column to start with Specific cell.

Now we migrated same DDE codes to UNIX environment,  we are facing issue like DDE not going to work in UNIX.

So trying ODS tagsets excelxp in UNIX as alternate to DDE to generate report in Excel to start with Specific cell.

Please help to give some sample code or some solution for this scenario.

my Email - ashok82sas@gmail.com


Super User
Posts: 11,343

Re: Ods tagsets.excelxp style: justify the categories of a variable

You would be better off starting your own thread as your issue is not related to the thread you are adding to. Be prepared to provide at least one example starting data set and what the final result should look like in the output.

And consider whether trying to fill single cells is better than recreating the whole report.

SAS Super FREQ
Posts: 8,866

Re: Ods tagsets.excelxp style: justify the categories of a variable

Hi:

  I don't understand what you're asking. Using DDE is not going to work with PROC TABULATE unless you create an output dataset. Did you look up the CLASSLEV statement??? You already use a STYLE= statement level override with your CLASS statement:      CLASS sex /style={just=r};

  So you merely have to look up and then use a CLASSLEV statement. For example, for AGE:

    CLASS sex age / style={just=r};  <--- added AGE here, so you can see both headers are right-justified

    CLASSLEV age / style={just=c};  <--- shows that the VALUES or LEVELS for AGE are center-justified separately from the HEADER label.

produces this:

cynthiaxp_output.png

Ask a Question
Discussion stats
  • 4 replies
  • 262 views
  • 0 likes
  • 4 in conversation