Hi I am trying to destring my values which contain a mixture of numbers and letters - see below
ID
0000366CAX878
00000HG78888
8787781HG0101
As it's a mixture of numbers and letters I am using the 'destring' function
Code:
destring ID, gen(ID_N) force
However, this generated a couple of thousand missing values - I have 1mill records
The same amount of missing values were generated with this code:
gen (ID_N) = real(ID)
How do I go about this problem?
____
Of course, I didn't use the encode option as I have 1mil records and although this would be the wrong function as it the table ID includes letters there are 'too many values'
ID
0000366CAX878
00000HG78888
8787781HG0101
As it's a mixture of numbers and letters I am using the 'destring' function
Code:
destring ID, gen(ID_N) force
However, this generated a couple of thousand missing values - I have 1mill records
The same amount of missing values were generated with this code:
gen (ID_N) = real(ID)
How do I go about this problem?
____
Of course, I didn't use the encode option as I have 1mil records and although this would be the wrong function as it the table ID includes letters there are 'too many values'
Comment