BookmarkSubscribeRSS Feed
JasonNC
Quartz | Level 8

Hi I am getting below format issue

 

proc format 
picture dollrfmt (round)
low - < 0 = '00,000)' (mult=.001 prefix='($')
0 - high = '00,000' (mult=.001 prefix='$');
run;

 

The number are represented below in 000 format as i want to represent the amounts in 000 's format but i am getting decimals which i don't want

 

$23,100.00
$5,182.00
$3,325.00
$2,070.00
$18.00

 

I am expecting the results in below format

 

$23,100
$5,183
$3,326
$2,070

 

 

I am using ods excelp xp tagsets and proc report,I am applying the format in proc report.

2 REPLIES 2
ballardw
Super User

Excel doesn't always honor the SAS format unless you use TAGATTR to specify the override appearance once it gets to Excel in the proc report code.

 

I suspect that if you look at the cell in Excel for the number format you may actualy see it is set to a dollar format which will default to 2 decimals in Excel.

 

jimbarbour
Meteorite | Level 14

 

I think the first line below should probably do the trick in terms of a TAGATTR.  The second line below is an example from a PROC REPORT.  Different format, but it should give you an idea of what it would look like in a PROC REPORT.

[TAGATTR="FORMAT:$#,##0"]

DEFINE	TIP_PIN_N 	/	DISPLAY		STYLE(COLUMN)	=	[BACKGROUND=WhiteSmoke	TAGATTR="FORMAT:##########"	FONT=("Calibri",8pt) ];

 

See also:

https://support.sas.com/resources/papers/proceedings11/266-2011.pdf

 

Regards,

 

Jim

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
  • 2 replies
  • 869 views
  • 0 likes
  • 3 in conversation