Hallo,

CLOSQLCSR *ENDMOD ist zwar nicht die beste Lösung, stellt aber sicher, dass bei jedem Aufruf des Programms ein full open erfolgt, also der komplette Optimierungsprozess ausgeführt wird.

Das Problem ist, so wie Du es beschreibst, entweder eine falsche Bibliotheksliste oder Overrides auf die falsche Bibliothek. Wenn das Problem auftritt würde ich als erstes die Bibliotheksliste und die Overrides prüfen.