A 40-year-old man presents with a 6-month history of intermittent epigastric pain, which is worse at night and relieved by food or antacids. He is a smoker and drinks 20 units of alcohol per week. He has tried over-the-counter antacids with minimal relief. What is the most appropriate next step in management?