South Africa close in on win but Masood anchors Pakistan fightback

Marco Jansen and Kagiso Rabada brought South Africa two wickets closer to victory