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

Re: st: parsing a variable positionally

From   Philip Ryan <>
Subject   Re: st: parsing a variable positionally
Date   Tue, 03 Jun 2008 18:04:52 +0930


the  substr()  string function might be useful.


 At 01:51 PM 3/06/2008, you wrote:
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?


*   For searches and help try:
Philip Ryan
Discipline of Public Health

Director, Data Management & Analysis Centre

Associate Dean (IT)
Faculty of Health Sciences

postal address:
Discipline of Public Health
Mail Drop 511
University of Adelaide 5005
South Australia

Level 6, Room 6-18
Bice Building
Royal Adelaide Hospital
North Terrace

tel +61 8 8303 3570
fax +61 8 8223 4075
CRICOS Provider Number 00123M
This email message is intended only for the addressee(s)
and contains information that may be confidential and/or
copyright. If you are not the intended recipient please
notify the sender by reply email and immediately delete
this email. Use, disclosure or reproduction of this email
by anyone other than the intended recipient(s) is strictly
prohibited. No representation is made that this email or
any attachments are free of viruses. Virus scanning is
recommended and is the responsibility of the recipient.

*   For searches and help try:

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