Convert variable from character to numeric
Thanks to Paul Duckman for this. Suppose you have a datafile with a character variable (var) that you want to convert to a numeric variable. While this is not possible, the following code replaces the character variable with a numeric variable of the same name.
1. data datfile (drop = tmp);On line 2, the character variable is renamed. One line 3, a new numeric variable is created, with the same name as the original character variable, and its value is set. On line 1, the temporary variable is deleted.
2. set datfile (rename = (var = tmp));
3. var = input (tmp, best4.);
4. run;
7 Comments:
Thank you for this neat code! It is very helpful!
Hello,
When ever I surf on web I come to this website[url=http://www.weightrapidloss.com/lose-10-pounds-in-2-weeks-quick-weight-loss-tips].[/url]dickduckssastips.blogspot.com is filled with quality info. Do you pay attention towards your health?. Are you really serious about your weight?. Recent Research points that almost 60% of all USA grownups are either chubby or overweight[url=http://www.weightrapidloss.com/lose-10-pounds-in-2-weeks-quick-weight-loss-tips].[/url] Therefore if you're one of these citizens, you're not alone. In fact, most of us need to lose a few pounds once in a while to get sexy and perfect six pack abs. Now the question is how you are planning to have quick weight loss? You can easily lose with with little effort. You need to improve some of you daily habbits to achive weight loss in short span of time.
About me: I am blogger of [url=http://www.weightrapidloss.com/lose-10-pounds-in-2-weeks-quick-weight-loss-tips]Quick weight loss tips[/url]. I am also health expert who can help you lose weight quickly. If you do not want to go under painful training program than you may also try [url=http://www.weightrapidloss.com/acai-berry-for-quick-weight-loss]Acai Berry[/url] or [url=http://www.weightrapidloss.com/colon-cleanse-for-weight-loss]Colon Cleansing[/url] for quick weight loss.
Thanks for sharing this. Very helpful indeed.
John put Alicesback to the wall to offer a profile shot as he rucked up her skirt andworked her panties down. Just because Ineed you now doesnt mean I wont kill you later, she spat.
free femdom stories
free male masturbation stories
free pony zoo porn stories
gay old men stories
erotic sex stories with pictures
John put Alicesback to the wall to offer a profile shot as he rucked up her skirt andworked her panties down. Just because Ineed you now doesnt mean I wont kill you later, she spat.
Unrelated, but yet somehow related to the problem posted.
I have a series of N data files that I am looping through and for N-2 data files variable x is numeric and for the last 2 is character. I need to append all these data and so I attempted to simply convert all x variables in all data files into numeric using the input function. However, for the first N-2 files, x becomes a character variable and for the 2 files it does become numeric! I am going crazy right now.
Even if I set new_x = x; where x is numeric, new_x appears as character. Any help is much appreciated!
Thanks!
What's up, after reading this awesome post i am too cheerful to share my experience here with mates.
My blog post; 38000ft.com
I like the valuable info you provide in your articles.
I'll bookmark your weblog and check again here regularly. I am quite sure I'll learn many new stuff right
here! Best of luck for the next!
Feel free to visit my homepage; book of ra online spielen um echtes geld
Post a Comment
<< Home