## Taking away a digit

Solved
Occasional Contributor
Posts: 13

# Taking away a digit

[ Edited ]

Thanks in advance for your help. I am still a beginner in SAS.

We have 4 numerical variable with different lengt

a b c d

d=a + b + c

We know that a b and d are correct but c can have sometimes one digit too much (can be anywhere in the number).

Do you have an idea how should I code to take away the extra digit in c ? (we can create a new c that is correct)?

Big thanks

edit: we can only take away a digit in c, if by taking a digiti, it's still wrong we want to keep the c value has it is (so user can have a check on it)

Accepted Solutions
Solution
‎07-07-2016 06:50 AM
Super User
Posts: 23,661

## Re: Taking away a digit

If you have all 4 variables isn't the following true:

``C = d - a - b;``

Can you calculate C instead of correcting it?

All Replies
Solution
‎07-07-2016 06:50 AM
Super User
Posts: 23,661

## Re: Taking away a digit

If you have all 4 variables isn't the following true:

``C = d - a - b;``

Can you calculate C instead of correcting it?

Occasional Contributor
Posts: 13

## Re: Taking away a digit

as I edit my post we can't do that as if by taking away a digit it's not correct, we want the user to check it (to be sure it's not wrong with a,b,d).

Occasional Contributor
Posts: 13