Many thanks to N. Cox for the accurate answer to my problem.
I just want to make clear why I prefer a string id over a numerical id.
While I can store it as a long or double with no precision problems,
I've had some difficulties with some operations. For instance, I
sometimes need to egen - concat (say, "household id" and "person number"
to get "perdon id") and I've had "rounding" problems with that, and
being a number I cannot gen strX pid=hid+pernumber...
Though certainly the numerical is the most memory efficient way to store
an identifier, I felt a short string id might be a good compromise. I
will try to use the code provided to develop a "XXdecimal" system where
instead of using only A to F I can use all letters (does that have an
official name?).
Thanks again
Best,
Guillermo Cruces
*
* 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/