Dollar General and Dollar Tree both reported second quarter increases in average ticket and traffic amid a tough macroeconomic backdrop.