* 2nd-qtr gross margin declines 47 bps
* CEO hopes declines will moderate in 2nd half
* Earnings, comparable sales beat estimates
* Shares fall 5 pct (Adds details from conference call, updates share price)
Aug 31 (Reuters) - Dollar General Corp reported a slide in second-quarter profit margins on Thursday as it cut prices more aggressively to better compete in a retail industry set to be altered by Amazon.com Inc's purchase of Whole Foods Market.
Dollar General's shares fell 5 percent to $72.92 despite the discount retailer's better-than-expected sales.
Gross margin fell 47 basis points to 30.7 percent in the quarter ended Aug. 4. The slide was also steeper than some analysts' expectations.
Dollar General Chief Executive Todd Vasos attributed the decline chiefly to being "very aggressive" on pricing.
After closing its $13.7 billion acquisition of upscale grocer Whole Foods on Monday, Amazon lowered prices on items such as avocados and apples to compete better with retailers including Wal-Mart Stores Inc and Kroger Co.
The price cuts could force other grocers to lower prices, which in turn could make discount stores such as Dollar General follow suit and have their profit margins take a hit, said Edward Jones analyst Brian Yarbrough.
However, an analysis by Gordon Haskett Research Advisors on Tuesday showed that overall prices at Whole Foods were still high after selective cuts.
"In this environment, people sell first and ask questions later," Yarbrough said of Dollar General's stock decline on Thursday.
Dollar General and larger rival Dollar Tree Inc have largely held their own against cut-throat pricing competition as more customers visit dollar stores for quick fill-in trips or to buy store-branded toiletries and party supplies.
Tennessee-based Dollar General sells most products at $5 or less.
Vasos said he hoped the gross margin decline will be smaller during the rest of the year as Dollar General lowers distribution costs and sells more higher-margin private brands and non-consumable items.
"We're well priced today and I don't see us having to do anything that is very dramatic," Vasos said on a call with analysts.
Dollar General's comparable-store sales rose 2.6 percent, topping the 1.6 percent expected by analysts polled by Consensus Metrix, driven by the first increase in customer traffic in five quarters.
Traffic had declined in prior quarters partly due to reduced food stamp coverage in several U.S. states.
Dollar General's net income fell 3.8 percent to $294.8 million. Excluding items, it earned $1.10 per share, edging past analysts' average estimate of $1.09, according to Thomson Reuters I/B/E/S.
Net sales climbed 8 percent to $5.83 billion, beating expectations of $5.80 billion. (Reporting by Sruthi Ramakrishnan in Bengaluru; Editing by Sai Sachin Ravikumar)