Statalist


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

st: parsing a variable positionally


From   Rufus Peabody <[email protected]>
To   [email protected]
Subject   st: parsing a variable positionally
Date   Tue, 3 Jun 2008 00:21:50 -0400

Hey all,

I'm trying to convert a variable into a date. Ordinarily, this would be simple using Stata's date() functions, but one of my variables contains both month and date (i.e. 403 is April 3rd), while another contains year. I'm trying to split the month+date variable into two variables by parsing after the first character. I tried converting the variable to a string and using the "split" command, but it does not allow me to parse positionally; it merely allows me to specify a parsing character. Is there a way to parse by position?

Thanks,

Rufus
*
* 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/




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