TOKYO - The Nikkei stock index ended just shy of the 40,000 mark in a fresh record high Friday as a wide range of large-cap shares drew buying on eased concerns for the U.S. economy, and the weak yen continued to boost exporters.