Statalist The Stata Listserver

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

st: problems with converting from numerical to string

Subject   st: problems with converting from numerical to string
Date   Sun, 11 Jun 2006 00:28:46 -0500

Dear Statalist,
I am Stata7 user.
I have a problem with converting from numerical to string format.
My variable POP is in the format  %8.0f. The numbers in POP are whole, the 
largest entries consist of 8 digits. My problem is that after I do

gen str8 F=string(POP),

some of the entries of F variable are displayed in scientific notation form 
like this:

    F	         POP
1.45e+07	14531529

This only happens to entries consisting of 8 digits, the appearance of entries 
consisiting of less than 8 digits is not altered by conversion.

I would appreciate any help on how to deal with this problem.
With best regards,
Olena Stavrunova  

----- Forwarded message from -----
    Date: Wed,  7 Jun 2006 07:41:39 -0500
 Subject: .dct for dataset without end-of-line delimiter: record too long? 

Dear Statalist, 
I apologize if this is a duplicate - I was not sure whether my first message 
went on correctly.
I am Stata7 user.
I am trying to infile data from the datafile which does not have end-of-line 
delimiters. My dictionary file looks like this:

dictionary using mydata{
          float caseid %5f "id" 

I get the error message:
"8231 not allowed
dictionary invalid"

By trying different # in _lrecl(#) I figured that # must be less than 7999 in 
order for my dictionary file to work.
But the length of the line in my file is 8231.
I would greatly appreciate any advise on how I can infile variables from this 
With best regards,
Olena Stavrunova 

----- End forwarded message -----

*   For searches and help try:

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