BookmarkSubscribeRSS Feed
Q1983
Lapis Lazuli | Level 10

proc format;                                    

   picture mypct /*(round) */                      

      /* low-high='00.0009%';   /*digit selectors '0009%' */ 

 low-99='00.0000%'

99 - high='100%';

run;

 

proc sql;

create table app_summary2 as

select LOAN_OFFICER,RACF_ID,sum(stp) as stp1, sum(ln_cnt) as ln,

sum(stp)/sum(ln_cnt)*100 as pct12 format=mypct.

from app_summary

group by LOAN_OFFICER,RACF_ID

;quit;

proc sort data= app_summary2;by loan_officer;run;

 

I use ODS Tagset excel

ODS TAGSETS.ExcelXP file="&ReportOut..xml" Path="&OutDir" style=&dors_style;

 

%CoverSheet(&ReportName,&pbd_date_key,&Version);

ODS TAGSETS.ExcelXP

   options(sheet_interval='none'

           default_column_width='8'

           sheet_name="Summary"

           center_horizontal="no"

             frozen_headers = "no"

           Orientation='Landscape'

           embedded_titles='Yes'

           fittopage="No"

           blackandwhite="No"

           Embedded_Footnotes='Yes'

              absolute_column_width='7'

           autofit_height="Yes");

 

 

Proc tabulate data=app_summary2 order= data format=10. S=[cellwidth=80];        

Class LOAN_OFFICER racf_id /missing;

Var stp1 pct12 ln;

Tables LOAN_OFFICER * racf_id =' ' all={label='Total' S=[background = lightblue cellwidth=80]} *[STYLE=[Font_Weight=bold]],

         all={ label='Apps Sent Summary'  S=[background = lightblue]} *[STYLE=[Font_Weight=light]]

           *(pct12 =''*mean ='Total % Sum of % Sent to Processing'  *f=mypct.

                stp1 =' '*sum='Sum of SENT_TO_PROC_BY_END_RPT_MO'

              ln=''*sum ='Sum of CT_LN_NBR' )     

           / box='Loan Officer and LO_RACF';

           keylabel n='';      

run;

 

 

 

pct12(Total % Sum of % Sent to Processing)  is the problem When it exports I loose 2 digits from the display. I get

Total % Sum of % Sent to Processing

Sum of SENT_TO_PROC_BY_END_RPT_MO

Sum of CT_LN_NBR

 

70.00%

14

20

 
 

61.90%

13

21

 

66.67%

8

12

 

I should be getting for digits such as

70.0050%

60.9012%

 

4 REPLIES 4
Reeza
Super User

When formatting data for Excel you need to use TAGATTR to format your fields and you use Excel formats not SAS formats.

 

Q1983
Lapis Lazuli | Level 10

Can you give an example?

Reeza
Super User

You can find examples here:

http://www.sas.com/events/cm/867226/ExcelXPPaperIndex.pdf

 

Find the topic of interest in the first column and the last column tells you what paper and page has the example. If you look at the bottom of the file, there are links to each of the documents.

 

Excel Format is what you're looking for.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 869 views
  • 1 like
  • 3 in conversation