U.S. stocks managed to close modestly higher on Wall Street Friday after a day of wobbling between gains and losses.

The S&P 500 wound up with its biggest weekly drop since late March.

The market’s enthusiasm was checked by yet more grim data showing how badly the coronavirus pandemic is crippling the economy. Retail sales sank a record 16.4% in April and industrial production plunged a record 11.2%. At the same time, investors are cautiously optimistic that the fallout from the outbreak will begin easing as more U.S. states reopen their economies.

New data from the Commerce Department showed U.S. retail sales dropped more than 16 percent in April as coronavirus lockdowns kept diners and shoppers at home.

It is the biggest two-month decline since 1992, and reveals the devastating impact the ongoing pandemic is having on American business.

The Federal Reserve also reported that industrial production plunged a record 11.2% in April. Overseas, Germany’s economy shrank in the first quarter, meaning that Europe’s largest economy is in a recession.

As the U.S. reported more than 2.9 million more Americans filed jobless claims in the last week, Carnival Cruises announced plans to lay off or furlough nearly half of its Florida employees.

Analysts expect Wall Street to remain in a wait-and-see approach for weeks as investors gauge how economic reopenings are going.

Stock indexes started the day in the red but clawed back into positive territory by the close of trading.

The Dow Jones Industrial Average closed the day up 60.08 or .25% to 23,685.42.

The NASDAQ composite index ended up 70.84 or .79% to 9,014.56.

The S&P 500 was up 11.20 or .39% to 2,863.70.

Reopening

While there is hope for a speedy economic reopening, investors want to see if second waves of coronavirus infections occur if governments lift their restrictions on businesses too soon.

As shutdowns are lifted in the coming days, many stores will reopen but some might not survive.

On Thursday, the Centers for Disease Control and Prevention in Atlanta released six “decision trees” aimed at helping businesses, employers, communities, schools, camps, day cares and mass transit decide on whether it’s safe to reopen.

A new ABC News poll finds that nearly three in four Americans believe there are not enough coronavirus tests available in the U.S.

Federal health officials continue to tout diagnostic testing as one of the best defenses against spreading the virus, along with contact tracing and social distancing measures.

Trade tensions

Recently, worries about renewed U.S.-China tensions have also weighed on markets. A bruising trade war between the two had dragged on the global economy before the pandemic hit.

“I have a very good relationship,” with China’s leader, Xi Jinping, Trump said in an interview with Fox Business Network, “but I just — right now, I don’t want to speak with him. I don’t want to speak with him.”

China

Global shares wavered between gains and losses Friday as investors weighed an improvement in data about China’s economy against new figures showing Germany has fallen into recession.

Factory output rose in April as China’s virus-battered economy reopened but job losses depressed consumer spending, a key driver of growth, challenging the ruling Communist Party’s push to revive normal activity.

Investment in factories and other fixed assets also improved as businesses reopened after China’s deepest economic slump since at least the 1960s, official data showed Friday.

China, where the pandemic began in December, was the first economy to shut down to fight the virus and the first to start reopening in March. Automakers and some other manufacturers say production is back to normal, but retailing and other industries are struggling.

The signs of progress in getting growth back on track in the world’s second biggest economy remain overshadowed, however, by worries over possible future waves of coronavirus outbreaks, while comments by President Donald Trump suggest a risk of another flare up in trade tensions between the U.S. and China.

“Bright spots in the markets and the economy should not breed complacency about being out of the woods,” Riki Ogawa of Mizuho Bank said. “Fact is, even as economies prepare to emerge from varying degrees of lockdown, restoration of ‘normalcy’ is a much longer road.”

China on Friday posted its first rise in industrial output since the outbreak began.

Hong Kong airline Cathay Pacific posted a $4.5 billion loss in the first four months of 2020 as passenger traffic dropped 99.6 percent in April.

Europe

In Germany, official figures showed Europe’s largest economy fell into recession in the first quarter, like France and Italy, with a 2.2% quarter-on-quarter decline in GDP. The data fills in detail on earlier released GDP figures that had shown a 3.8% contraction in the 19-country eurozone.

European indexes lost some of their early gains, with France's CAC 40 flat at 4,273 and Germany's DAX up 0.9% at 10,425. Britain's FTSE 100 gained 0.6% to 5,773. U.S. shares appeared set to slip on the open, with Dow and S&P 500 futures both down 0.7%.

In Italy, retail stores and other businesses will reopen on Monday, according to a draft decree obtained by Bloomberg News. One of the early hotspots of the outbreak, Italy will allow citizens to move freely between its 20 regions starting June 3, the outlet reports.

Denmark’s GDP shrank by 1.9 percent in the first quarter, according to preliminary figures released by Danish central statistics office. It was the biggest decline in a quarter since the financial crisis of 2009.

The latest on oil

In other trading, U.S. benchmark crude picked up 46 cents to $28.02 a barrel in electronic trading on the New York Mercantile Exchange. It gained $2.20 to $27.88 a barrel on Thursday.

Brent, the international standard, added 54 cents to $31.67 a barrel.

Brazil’s Petrobras reported a $8.35 billion loss in the first quarter of 2020 amid oil’s “worst crisis in 100 years.”

Japan

Japan’s benchmark Nikkei 225 recouped earlier losses to finish at 20,037.47, up 0.6%. South Korea’s Kospi gained 0.1% to 1,927.28 Australia’s S&P/ASX 200 added 1.4% to 5,404.80. Hong Kong's Hang Seng lost 0.1% to 23,799.42, while the Shanghai Composite inched down less than 0.1% to 2,868.46.

Japan on Friday ended its state of emergency for many regions less affected by COVID-19 outbreaks. It is gradually easing requests for people to stay home and for some businesses to stay closed despite rising numbers of cases overall.

The Keidanren, which represents more than 1,000 Japanese companies and regional economic groups, released guidelines for safer work, including instructions on having office workers coming into the office just three days each week to minimize commutes, and adapting workplaces for social distancing.