SA markets closed in the green, rand strengthens against dollar