Aim: The aim was to develop a high-performance computer-aided diagnosis (CAD) system with image processing and pattern recognition in diagnosing pancreatic cancer by using endosonography images. Materials and Methods: On the images, regions of interest (ROI) of three groups of patients (<40, 40-60 and >60) were extracted by experts; features were obtained from images using three different techniques and were trained separately for each age group with an Artificial Neural Network (ANN) to diagnose cancer. The study was conducted on endosonography images of 202 patients with pancreatic cancer and 130 noncancer patients. Results: 122 features were identified from the 332 endosonography images obtained in the study, and the 20 most appropriate features were selected by using the relief method. Images classified under three age groups (in years; <40, 40-60 and >60) were tested via 200 random tests and the following ratios were obtained in the classification: accuracy: 92%, 88.5%, and 91.7%, respectively; sensitivity: 87.5%, 85.7%, and 93.3%, respectively; and specificity: 94.1%, 91.7%, and 88.9%, respectively. When all the age groups were assessed together, the following values were obtained: accuracy: 87.5%, sensitivity: 83.3%, and specificity: 93.3%. Conclusions: It was observed that the CAD system developed in the study performed better in diagnosing pancreatic cancer images based on classification by patient age compared to diagnosis without classification. Therefore, it is imperative to take patient age into consideration to ensure higher performance.