[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Can't Read "00020" as a Character in Stata?
Add an a in front of the 0020. This will trick STATA to think it is a
string. Once read, do a replace in STATA.
> Hello all,
> I encounter a data input problem in Stata. I have a fixed format file,
> i.e., abc.raw, and there are ID numbers that I would like to read them in
> character format. However, the way the ID numbers are created makes it
> hard to do so. For example, I have an ID is "00020", but Stata read it as
> "20". Can anyone help me out here? I use "infix id 1-5 using ..." but it
> does not work.
> My second question is whether there is a way to use "infix" command more
> efficiently, given that fact that I have 241 variables. In SAS, I can do
> "input var1 $10. var2 $10. ..." In Stata, however, it seems that I have to
> specify the columns. Can I do anything similar to SAS in Stata by only
> specifying the format of the variable and Stata will figure out the column
> Thanks a million! I would greatly appreciate your help!!!
> Switch to Netscape Internet Service.
> As low as $9.95 a month -- Sign up today at
> Netscape. Just the Net You Need.
> New! Netscape Toolbar for Internet Explorer
> Search from anywhere on the Web and block those annoying pop-ups.
> Download now at http://channels.netscape.com/ns/search/install.jsp
> * 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/
Albert J. Lee, Ph.D.,
Summit Consulting LLC*
1310 12th Street, Suite 1
Washington DC 20005
(202) 588 1092
At HUD (202) 708 0614 ext 7562
*Summit Consulting is a SBA certified 8a company
* For searches and help try: