Proc tabulate data=app_summary2 order= data format=10. S=[cellwidth=80]; /* order= formatted format=PCTFMT.;*/
Class LOAN_OFFICER racf_id /missing;
Var stp1 pct 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]]
*(pct =''*mean='Total % Sum of % Sent to Processing'
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;
This code creates a column of data. I want the first column called pct to display all numbers with a percentage sign next to it. I tried order=formatted and used a created picture format however it made all columns into percentages
Code for Last_Mo_Apps_Sent.sas | ||||
Loan Officer and LO_RACF | Apps Sent Summary | |||
Total % Sum of % Sent to Processing | Sum of SENT_TO_PROC_BY_END_RPT_MO | Sum of CT_LN_NBR | ||
Loan Officer | 100 | 2 | 2 | |
doe | UVAY6 | |||
deed | UVAD89 | 68 | 15 | 22 |
Total | 84 | 17 |
24
|
If you divide your PCT variable by 100 then you could use the PERCENT5.0 format as in
*(pct =''*mean='Total % Sum of % Sent to Processing'*f=percent5.0
stp1 =' '*sum='Sum of SENT_TO_PROC_BY_END_RPT_MO'
ln=''*sum ='Sum of CT_LN_NBR' )
Putting the "f=" in that location assign the format just to the PCT var.
If you don't want to rescale PCT then you could use PROC FORMAT with a PICTURE statement to make your own format. Seomthing like:
proc format;
picture myfmt low-high='000%';
run;
Then put its name where the "percent5.0" is above.
xxx
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.
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.