Any reason why piece doesn't appear to allow the length of pieces to be 1?
e.g.
. local subpiece: piece 2 1 of "abcdefghi"
invalid syntax
r(198);
SYNTAX: piece #piece_number #length_of_pieces of [`]"string"['] [,
nobreak ]
<-- no restriction is mentioned on the STATA help system.
And is piece going to be computationally faster than substr?
cheers
Ade
Adrian Mander MSc PhD, Principal Statistician, GlaxoSmithKline, Mail Code
HW8133, New Frontiers Science Park (South), Harlow, Essex, CM19 5AW. Tel:
01279 63 1203 Fax: 01279 64 4003
*
* 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/