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

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 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
  • 0 replies
  • 534 views
  • 0 likes
  • 1 in conversation