On Sept. 14, two major oil sites in Saudi Arabia were attacked, leading to a 5% loss in the supply of crude across the globe. This has obviously also affected the stock prices of oil and gas companies. A rise in the price of oil should generally benefit these businesses, but buying a stock when it's at the top is not a good decision. That's why you need to identify companies that are not solely engaged in production. Here are two stocks that are ideal for the long term. 

  1. Royal Dutch Shell (NYSE:RDS-A)
  2. EOG Resources (NYSE:EOG)

The table below shows both stocks' movement over the past month.

Image Source: YCharts

Impressive dividends at Royal Dutch Shell

Some of the big companies are producers of oil, but they also boast distribution and marketing operations that keep their stock prices less susceptible to major swings. Royal Dutch Shell is an ideal investment for those who want to restrict the volatility of their portfolio and for investors who are on the lookout for a good dividend payout. Shell's dividend yield is high, at 6.5%, and it should be safe even in a price downturn -- unlike many of its competitors, Shell did not cut its dividend during previous slumps.

The stock is enjoying an attractive valuation, and investors are used to the company knocking its earnings numbers out of the park. At 11.7 times earnings, Shell is valued much lower than many of its peers. Total earnings were $24.4 billion in 2018, and $6.8 billion came from the upstream sector (the operations stage, involving exploration and production). 

Shell has the capacity to start up new assets, and as these endeavors progress through the ramp-up stage, they should bring high earnings in the future. 

Shell's operating cash flow of $10.5 billion generated organic free cash flow of $6.2 billion in the quarter. This easily covers the dividend of $3.9 billion paid this quarter, as well as share buybacks worth $2.15 billion. This stock is a dividend payer, a strong outperformer, and a good buy. 

Image Source: YCharts

EOG Resources: High quality, strong returns

One of the largest U.S. production and exploration companies, EOG focuses on returns over production growth. That said, the company has successfully managed to boost production and increase free cash flow over the past year, and it has reduced the cost of completed wells as well. Improvements to its oil recovery technology should serve as a production driver for the long term, and the company is also likely to benefit from the high geopolitical risk premium in the price of oil after the Saudi attack. Analysts have a price target of $110, and I consider it a strong buy. 

Because oil prices are volatile and the future is uncertain, this top-quality stock is bought a lot. The biggest competitive advantage this company has is its thousands of drilling locations, which generate significant returns even during a weak oil-price environment. EOG Resources also has 9,500 premium locations that are not drilled, from which it can generate about 30% returns when in a low price environment.

Management has consistently managed to reduce costs, with cash operating expenses declining from $9.36 per barrel in 2018 to $9.24 per barrel in 2019. It's able to sell oil at a price higher than many others, giving it a price advantage over its peers. It also has great exposure to the international market, where it has signed agreements which increase its export capacity.

EOG's growth is driven by its high level of production and export capacity. A 21% year-over-year increase in the production of oil should help offset the dip in oil prices, and free cash flow of $182.3 million is an impressive performance. 

Seeking out winners

Oil stocks can be volatile, especially when attacks and other unpredictable events shake their foundations. But there are still winners to be found in the space. Both Shell and EOG make for great long-term plays with their strong dividends and ability to make money even in a weak environment for oil prices.

Vandita Jadeja has no position in any of the stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.