Sensex Ends Near Record High On Earnings Optimism