I'm trying to write a loop that iterates through every single variable in a varlist and performs different tasks depending on whether the variable is set as regular or imputed as follows

Code:
mi register regular x y z
mi register imputed a b c
From what I've gathered, I think I can use mi query in the loop to check this, but I'm not sure what the proper syntax for it would be.

Thanks in advance!