BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LuAnnS
Fluorite | Level 6

I'm having trouble with proc report.  I run a proc sort, set my options then run a proc report on a dataset that has all numbers previously rounded in an earlier step (= round(field_name * factor,.01);).  I can see in the dataset what the pennies are.  If I export the dataset to excel, I have the same pennies.    When i run proc report though, all calculated amounts over one million are rounding the pennies to the nearest tenth.  It's not doing this to numbers under one million.  I'm writing my code in SAS EG 7.15 HF7 (7.100.5.6177) (32-bit).  Is this an issue anyone else has found?  Am I using the wrong options, tags or attributes?  it's a very complex program so i'm trying to pull out part of the code that might be helpful.  Thanks in advance for any thoughts/ideas you might have

 

 

 

OPTIONS MISSING=' ' nobyline bottommargin=.1IN topmargin=.1IN leftmargin=.1IN rightmargin=.1IN;
Ods tagsets.excelxp options (sheet_name='National Detail' ORIENTATION="LANDSCAPE" embedded_titles = "yes"
frozen_headers = '4' row_repeat = '1-4' skip_space='1,1,0,1,1' Center_Horizontal= 'yes'
autofit_height='yes');

 

define field_name /analysis 'field*title' style=[WIDTH=.7IN tagattr="format:$#,##0;[Red]\(#,##0\)" ]
style(header)={BACKGROUND=VERY LIGHT moderate green};

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

A format of DOLLAR9.2 will not have room for numbers over 1 million. 

That would require a format width of 13 characters.

59    data _null_;
60      input ;
61      list;
62    cards;

RULE:       ----+----1----+----2----+----3----+----4
63          $1,000,000.23

View solution in original post

2 REPLIES 2
LuAnnS
Fluorite | Level 6
I tried adding a format to the define statement but it didn't change the excel output

define DENFI_Prem_Curr /analysis 'FI*Den' Format=DOLLAR9.2 style=[WIDTH=.9IN tagattr="format:$#,##0.00;[Red]\(#,##0.00\)" ]
style(header)={BACKGROUND=VERY LIGHT moderate green};
Tom
Super User Tom
Super User

A format of DOLLAR9.2 will not have room for numbers over 1 million. 

That would require a format width of 13 characters.

59    data _null_;
60      input ;
61      list;
62    cards;

RULE:       ----+----1----+----2----+----3----+----4
63          $1,000,000.23

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 493 views
  • 0 likes
  • 2 in conversation