Hi,

In my data set answers below zero each show a different type of missing value (e.g. not answered or not asked etc. from -1 to -10) and I want to replace them all with missing values.

I have made a global list named alist like this:

global alist Date Age Education Employment1 Employment2 Sex Stress1 Stress2 ///
JobControl1 JobControl2 JobControl3 JobDemand1 JobDemand2 JobDemand3 ///
Depression1 Depression2 Depression3 Depression4 Depression5 SocialSupport1 ///
SocialSupport2 SocialSupport3 SocialSupport4 SocialSupport5 SocialSupport6 ///
SocialSupport7 SocialSupport8 SocialSupport9 SocialSupport10
and then called them to be replaced like this:

foreach var of $alist {replace `var' =. if (`var'<=0)}
but I am getting this error that tell me :
program error: code follows on the same line as open brace
can any one tell me what should I change? I've been googling but could not find any way to do it.

Many thanks and appreciation.