I wonder if its possible get a variable list for a condition, example:

Code:
clear all
sysuse auto
ds, has(type string)

unab allvars: _all
unab vars_to_exclude: make


replace mpg =. if mpg >33

foreach i in `:list allvars - vars_to_exclude' {
  display "`i'"
  list `i' if `i'==.
}

price
mpg

     +-----+
     | mpg |
     |-----|
 43. |   . |
 57. |   . |
 66. |   . |
 71. |   . |
     +-----+
rep78

     +-------+
     | rep78 |
     |-------|
  3. |     . |
  7. |     . |
 45. |     . |
 51. |     . |
 64. |     . |
     +-------+
headroom
trunk
weight
length
turn
displacement
gear_ratio
foreign
My goal its get something:

Code:
*Just an idea:

ds, has(vlist)
mpg rep78

 or

foreach v of local vlist {
    di  "`v'"
}

mpg rep78

Please any advice I would grateful
Regards
Rodrigo