BookmarkSubscribeRSS Feed
Belle
Obsidian | Level 7

Hello,

I am trying to produce a report by using ODS TAGSETS.EXCELXP.

How can I make all the column names and values right justify?

In my result, I used label name as output column name. Unfortunately, I did not get all the column names and values right justify. Could you please let me know where I did wrong.

Here is the result that I got:

Result.png


Here is the result that I want:

result1.png


Here are the part of data from dataset FIN I use as input data:

Obs YYMM     _NAME_        _LABEL_       MISSING_    NON_MISSING_

  1 200104    COUNT     Frequency Count       18            53     

  2 200105    COUNT     Frequency Count       67            .


Below are part of my program:


DATA FINAL (DROP=_NAME_ _LABEL_);

   SET FIN;

   IF MISSING     = . THEN MISSING = 0;              

   IF NON_MISSING = . THEN NON_MISSING = 0;          

   PCT_MISS=MISSING/(MISSING+NON_MISSING);

   FORMAT PCT_MISS PERCENT9.1 ;                            

   LABEL justify=right MISSING      = "    Missing"

         justify=right NON_MISSING  = "Not Missing"

         justify=right PCT_MISS     = "PCT Missing";

RUN;

                      

ODS TAGSETS.EXCELXP                                              

   OPTIONS(SHEET_NAME    ="sheet name"                      

           FROZEN_HEADERS='1'                                    

           ROW_REPEAT    ='1'                                    

           WIDTH_FUDGE   ='0.6'                                  

ABSOLUTE_COLUMN_WIDTH='8,12.5,12.5,12.5'

           AUTOFILTER    ='1'                                    

           ORIENTATION   ='LANDSCAPE'                            

           FITTOPAGE     ='YES'                                  

          );                                                     

proc print data = FINAL noobs label;

run;

...


Thank you so much for the help in advance.


Belle

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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