BookmarkSubscribeRSS Feed
Daniela_P
Obsidian | Level 7

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

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

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

AshokSas
Calcite | Level 5

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


ballardw
Super User

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.

Cynthia_sas
SAS Super FREQ

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 932 views
  • 0 likes
  • 4 in conversation