DATA Step, Macro, Functions and more

make 0 instead of 0.0000000000027

Accepted Solution Solved
Reply
Contributor
Posts: 47
Accepted Solution

make 0 instead of 0.0000000000027

HI I have a column called Claim, I want to create a new column New_claim as shown below  

 

ClaimNew_Claim
0.000000270
-0.00003450
-0.000000660
0.0000450
-0.000090
0.0000000560
-0.000001230

Accepted Solutions
Solution
‎02-25-2017 12:43 PM
Super User
Super User
Posts: 6,502

Re: make 0 instead of 0.0000000000027

Are you just looking for the ROUND function?

It is hard to tell from your example if you want to round the value to integers?

new_claim = round(claim,1);

Or perhaps to hundredths?

new_claim = round(claim,0.01);

 

View solution in original post


All Replies
Solution
‎02-25-2017 12:43 PM
Super User
Super User
Posts: 6,502

Re: make 0 instead of 0.0000000000027

Are you just looking for the ROUND function?

It is hard to tell from your example if you want to round the value to integers?

new_claim = round(claim,1);

Or perhaps to hundredths?

new_claim = round(claim,0.01);

 

Super Contributor
Posts: 408

Re: make 0 instead of 0.0000000000027

Indeed we need to know the exact rule to be applied. Besides ROUND() there are also INT() and FUZZ().  Depending on the requirements one can pick and choose.

 

- Jan.

Super User
Posts: 17,868

Re: make 0 instead of 0.0000000000027

Depending on what you're doing this may be relevant. 

If that value is calculated, it may be easier to change to calculation. 

http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#p0ji1unv6thm0dn1gp4t...

☑ This topic is SOLVED.

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

Discussion stats
  • 3 replies
  • 114 views
  • 1 like
  • 4 in conversation