A 26-year-old male presents with a 2-year history of rhythmic epigastric pain, worsened by hunger, relieved by meals, and often waking him at night. Yesterday, he noticed black stools. Examination shows normal BP and pulse rate, mild tenderness in the upper abdomen without masses, and occult blood (+++). Which test is most helpful for definitive diagnosis?