Taking away a digit

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 13
Accepted Solution

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: 19,864

Re: Taking away a digit

Posted in reply to sylvainbg

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

 

C = d - a - b;

Can you calculate C instead of correcting it?

View solution in original post


All Replies
Solution
‎07-07-2016 06:50 AM
Super User
Posts: 19,864

Re: Taking away a digit

Posted in reply to sylvainbg

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

Re: Taking away a digit

Posted in reply to sylvainbg

I found the way to do it thanks

☑ This topic is solved.

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

Discussion stats
  • 3 replies
  • 251 views
  • 0 likes
  • 2 in conversation