BookmarkSubscribeRSS Feed
Guru_MG
Fluorite | Level 6

Syntax to Print Nett Sales (Monetary format) as a numeric format? 

Country        Nett Sales

Africa             $250

Asia               $300

Australia        $350

2 REPLIES 2
ballardw
Super User

If your values are currently of numeric type with a format such as Dollarw.d assigned then if you want the value without currency symbols you could use a format such as Fw.d, to display values without commas or currency, or Commaw.d to display values without currency symbol but including commas, or even something like BEST12. which would do the best job of fitting the values into 12 characters without currency symbols or commas.

 

IF your Nett Sales variable is currently a character variable then you need to convert it to numeric which would be done in a data step by creating a new variable with and input statement such as

 

data want;

    set have;

    nett_numeric = input(nett_sales,comma15.);

run;

 

 

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
  • 374 views
  • 0 likes
  • 3 in conversation