The Standard & Poor’s 500 Index rose Friday for a fourth day, the longest rally since October, as investors shook off data showing a decline in wages to focus on a surge in hiring that bolstered optimism the economy can weather a global slowdown. Commodity shares advanced after the data, with energy companies in the S&P 500 pacing gains for a fourth consecutive session, the longest streak in four months. Hewlett Packard Enterprise Co. surged almost 14 percent as quarterly results reassured investors about demand for corporate technology. Data Friday showed employers added more workers in February than projected, though wages unexpectedly declined. The 242,000 gain followed a 172,000 rise in January that was larger than previously estimated. The jobless rate held at 4.9 percent, while average hourly earnings dropped, the first monthly decline in more than a year. Bigger wage gains are needed help move inflation closer to the Federal Reserve’s goal. Fed officials gather for their next two-day meeting on March 15, with traders pricing in a less than one-in-10 chance the central bank will increase rates this month. The probability rose to 40 percent by mid-year following the jobs data. Odds for a December move increased to 68 percent.