Stocks recorded positive gains Wednesday after a report showing expansion in the service sector created an uptick in the major stock indices.

The market is "looking more at what the second quarter will hold. If you average the first quarter hit by weather and the second quarter rebound, that will be a truer indication of the run rate of economic activity," said Scott Clemons, chief investment strategist at Brown Brothers Harriman. 

"The second-quarter numbers have generally been pretty good, and are certainly indicative of growth," said Paul Nolte, senior vice president, portfolio manager at Kingsview Asset Management in Chicago. 

The Dow Jones Industrial Average was at 16,840.95, up almost 23 points at mid-day trading. Earlier in the day, it was up 54 points.

The S&P 500 is up 4.46 at mid-day trading. Healthcare stocks were the best performing stocks in the S&P 500.

The NASDAQ composite gained about 12 points in mid-day trading.

Uncertainity in the markets fell. The CBOE Volatility Index fell 2.8 percent to 11.79. When this index rises, investors are less confident in the economy and the markets.

Though the expansion of the service sector gave investors positive news, two separate reports from the government showed negative numbers.

The government reported the economy contracted 2.9 percent in the first quarter and durable goods declined 1 percent last month.

The service sector expansion was the greatest in more than four years. 

"In the midst of the poor first-quarter GDP report and mediocre durable goods figure, there was a bright spot in the data today," Peter Boockvar, chief market analyst at the Lindsey Group told CNBC by email.

Notable Stocks on the Move Wednesday

Hilton Worldwide Holdings Inc. is up almost 3 percent to $23.14. The hotel chain is listed as a "strong buy" by most analysts.

CBS Corporation is up almost 5 perecent to $61.70. The media company's shares are reacting positively to the streaming TV service Supreme Court ruling. CBS and other media companies disputed that Aereo was violating copyright laws with their streaming TV service.