Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: accuracy and preserving uniqueness of id

From   Devra Golbe <>
Subject   Re: st: accuracy and preserving uniqueness of id
Date   Tue, 25 Feb 2003 17:51:21 -0500

it's a good idea to read IDs as strings even if the characters are all numeric:

infix str id 1-18.....

At 05:33 PM 2/25/03, you wrote:
dear all,

i'm using -infix- to read in a large dataset into stata. each line of the
dataset begins with an 18 character, numeric, company identification
block. each company occupies several lines, that all start with the same
identification code. to make things clearer here's my sample code:

infix id 1-18 reccat 19-20 var1 21-25 var2 26-30 ... if reccat=11
infix id 1-18 reccat 19-20 var3 21-23 var4 24-27 ... if reccat=12

after i ran this i took a look at my resulting dataset and to my surprise,
the id displayed by Stata looked very different from the id i originally
had in my flat text file.

for example:

in text, id = 200101380110999991
in stata, id= 200101375269404672


in text, id = 200101380206999991(different from above)
in stata, id= 200101375269404672(same as above)

what's bothering me is that ids that are different in text become the same
in stata. is there a way to preserve the accuracy and hence uniqueness of
the ids in this situation?

thanks in advance,

Radu Ban

*   For searches and help try:
Devra L. Golbe, Professor
Dept. of Economics
Hunter College  / CUNY
695 Park Ave., NY, NY 10021
voice:  212-772-5408
fax:     212-772-5398 (office)
          208-361-5964 (e-fax)

*   For searches and help try:

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