BookmarkSubscribeRSS Feed
Q1983
Lapis Lazuli | Level 10

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

 

1 REPLY 1
mkeintz
PROC Star

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

 

 

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand in the Innovate Hub.

Watch 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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 1501 views
  • 0 likes
  • 2 in conversation