* Powell: "Several years" of strong jobs, low inflation ahead
* Dollar briefly pares gains after remarks, then strengthens
* J&J helps S&P 500, Dow; MSCI global stock gauge climbs
* Oil steadies as focus turns to surplus from shortage (Updates with afternoon U.S. trading)
By Lewis Krauskopf
NEW YORK, July 17 (Reuters) - The U.S. dollar rose on Tuesday against a basket of major currencies following an upbeat economic assessment from the head of the U.S. Federal Reserve, while world stocks climbed as a heavy week of corporate earnings also kicked into gear.
Wall Street's main indexes erased losses from the start of the session to trade solidly positive.
In written testimony, Fed Chairman Jerome Powell said the economy was on the cusp of "several years" of the job market remaining strong and inflation remaining around the Fed's 2 percent target. reacted modestly for the most part following Powell's prepared remarks, in which he signalled he believed the economy was doing well and that an era of stable growth may continue, provided the Fed gets its policy decisions right.
The U.S. dollar pared gains immediately following the release of the testimony, but then quickly bounced back and added to gains.
"He reiterated the view of the economy as being strong, growing at a solid pace with recent inflation data as more or less encouraging," said Peter Cecchini, chief market strategist at Cantor Fitzgerald in New York.
The Dow Jones Industrial Average .DJI rose 63.79 points, or 0.25 percent, to 25,128.15, the S&P 500 .SPX gained 12.88 points, or 0.46 percent, to 2,811.31 and the Nasdaq Composite .IXIC added 50.77 points, or 0.65 percent, to 7,856.49.
As a busy week of corporate earnings began, Netflix Inc NFLX.O shares dropped 4.9 percent after the company's subscriber growth fell short of Wall Street expectations, while Johnson & Johnson (NYSE:JNJ) JNJ.N shares gained 3.5 percent, boosting the S&P 500 and the Dow industrials, after the healthcare company's results topped estimates. pan-European FTSEurofirst 300 index .FTEU3 rose 0.26 percent, helped by Powell's testimony amid a batch of mixed company updates. gauge of stocks across the globe .MIWD00000PUS gained 0.20 percent.
The dollar index .DXY , tracking it against a basket of major currencies, rose 0.52 percent, with the euro EUR= down 0.47 percent to $1.1654.
U.S. Treasury yields rose, with the two-year yield hovering near a decade high, as Powell's comments supported traders' view of further rate increases from the U.S. central bank. 10-year notes US10YT=RR last fell 1/32 in price to yield 2.86 percent, from 2.856 percent late on Monday.
Oil prices steadied after steep falls on Monday as worries over supply disruptions eased and the focus moved to increasing production and potential damage to global growth from the U.S.-China trade dispute. crude CLcv1 rose 0.29 percent to $68.26 per barrel and Brent LCOcv1 was last at $72.43, up 0.82 percent on the day.