Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: adding leading zeros to variables


From   "Murali Kuchibhotla" <[email protected]>
To   [email protected]
Subject   st: adding leading zeros to variables
Date   Sun, 3 Aug 2008 22:04:22 -0500 (CDT)

Hello,
      I need to create a 9-digit variable out of a variable that is currently 
7 and 8 digits long by adding leading zeros to it. An example is provided 
below.

existing	required
1234567	        001234567
56789012	056789012
 
Also, please note that in the actual dataset the exact no. of observations 
with either 7 or 8 digits is not known.Any suggestions would be 
appreciated.Thanks.

Murali Kuchibhotla


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index