Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: cleaning string variables

From   Elizabeth Sanders <>
To   "" <>
Subject   st: cleaning string variables
Date   Mon, 11 Jul 2011 14:42:27 -0700 (PDT)

I have a string variable of the form



and want to create a new variable that is 1 if the value includes at least /ABC/ABC

I expect I will be searching for */ABC/ABC*, so I tried

gen newvar=oldvar
newvar if regexm(newvar, "*/ABC/ABC*")

but got an error "=exp required".

What am I missing?

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index