At 10:30 AM 9/15/2004 -0700, Alejandro wrote:
How can I extract the last 5 digits a 9-digit number
(say a social security number) creating a new variable
?
i.e.
X newvar
999912345 ---> 12345
[...]
Try this:
gen long newvar = mod(X, 100000)
-- David
David Kantor
Institute for Policy Studies
Johns Hopkins University
[email protected]
410-516-5404
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/