Many retailers reported better-than-expected results in July as warm weather and clearance sales drew shoppers into stores.