If you make a string variable with leading
zero into a numeric variable there is one,
and only one, sense in which you can keep
the leading zero. You can apply to it
a format (e.g. %04.0f) that forces
display with leading zeros. If you need
the leading zero for calculations or
other manipulations then you need both
string or numeric versions.
Nick
[email protected]
Seyda G Wentworth
> I need to create a numeric variable (numvar) out of a string
> (stringvar) to be able to say things like:
>
> sum x y z if numvar==5
>
> The string variable is a code with values such as 0107,
> 0256, etc. How can I make it numeric without loosing the "0"
> in front? In other words I want to keep all the digits.
*
* 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/