U.S. stocks turned mostly higher on Friday as the S&P closed at fresh record for the third time this week.