Wich command to keep last 2 numbers

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Wich command to keep last 2 numbers

Eugenio Grant
Hi:



I have the ID var with numbers 1, 2, 3, 4, 5, 6, .. 3000. I want to keep the
cases in wich the ID's last to numbers are 23, so I have to keep 23, 123,
223, 323, etc.



Which is the command that I need, ID is a numeric variable.



Thanks for your time.
Reply | Threaded
Open this post in threaded view
|

Re: Which command to keep last 2 numbers

Richard Ristow
At 03:08 PM 12/20/2006, Eugenio Grant wrote:

>I have the ID var with numbers 1, 2, 3, 4, 5, 6, .. 3000. I want to
>keep the cases in wich the ID's last to numbers are 23, so I have to
>keep 23, 123, 223, 323, etc.

Quickly: the last two digits of a numeric variable 'ID' can be
calculated as

MOD(ID,100)