Hi all,

I am trying to select only binary variables, I tried with assert option rc0 but lamentably I can not get a flag, example

Code:
clear all
set more off
sysuse auto

 assert inlist(foreign , 0. 1), rc0

Dont got a flag
I tried others ways but I have not success:

Code:
foreach y of varlist * {

  if (assert inlist(`y' , 0. 1 )){
      di "`y'"
  }
    
 }

error
 
foreach y of varlist * {

      di "`y'" if assert inlist(`y' , 0. 1)
    
 }

error
I am using stata 13, Thanks in advance.
Rodrigo