Desktop productivity for business analysts and programmers

PUT(var, FORMAT) not working?

Accepted Solution Solved
Reply
Contributor
Posts: 34
Accepted Solution

PUT(var, FORMAT) not working?

I m using this expression in the query builder task of EG 9.1:

 

PUT(t1.OpRevenue, COMMA8.2)

 

OpRevenue is "10.5" and I need "10,5".

According to the documentation, this should be the way how it is done, but it is not working.

I still get "10.5".

 

What am I doing wrong?


Accepted Solutions
Solution
‎09-15-2016 08:12 AM
Super User
Posts: 7,446

Re: PUT(var, FORMAT) not working?

Look if the COMMAX format does what you want.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Super User
Super User
Posts: 7,720

Re: PUT(var, FORMAT) not working?

Have a look at the Documentation:

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000200667.htm

It  states that the comma format applies a comma after each block of three in the whole part of the number.  It doesn't replace dot with comma.  

You could of course do:

tranwrd(put(t1.oprevenue,8.2),".",",")

 

I don't know of a format offhand which treats numbers using the comma notation.

Contributor
Posts: 34

Re: PUT(var, FORMAT) not working?

I think I was missinterpreting something. I guess COMMAX8.2 will do it! Thanks!

Solution
‎09-15-2016 08:12 AM
Super User
Posts: 7,446

Re: PUT(var, FORMAT) not working?

Look if the COMMAX format does what you want.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 256 views
  • 0 likes
  • 3 in conversation