Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- General Programming
- /
- Taking away a digit

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-07-2016 02:41 AM - edited 07-07-2016 02:53 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-07-2016 02:52 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-07-2016 02:52 AM

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

`C = d - a - b;`

Can you calculate C instead of correcting it?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-07-2016 02:59 AM

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).

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-07-2016 06:50 AM

I found the way to do it thanks