Help using Base SAS procedures

How to right justify column name?

Reply
Contributor
Posts: 67

How to right justify column name?

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

Ask a Question
Discussion stats
  • 0 replies
  • 113 views
  • 0 likes
  • 1 in conversation