It looks like both results are correct, and this is just a case of multiple optimal solutions. I have several suggestions for you.
1. The code does not define count_x, which I assume is 67. But it is simpler to use the modelin index set instead. That is, replace 1..&count_x with modelin and replace &count_x with card(modelin).
2. Rather than repeat the sum formula, you can first declare p and then use p in the constraint, as follows:
min p = sum{i in modelin} (cdf("Normal", (a + b*zscore[i])));
con y : p / card(modelin) >= 0.0008;
3. The problem is nonconvex, so to discourage getting stuck in a local minimum, you should use the MULTISTART option (alias MS):
solve with nlp / ms;
4. If you prefer to avoid the spikes, you can use a different objective that minimizes the maximum value:
min p = sum{i in modelin} cdf("Normal", (a + b*zscore[i]));
con y : p / card(modelin) = 0.0008;
min MinMaxObj = max{i in modelin} cdf("Normal", (a + b*zscore[i]));
5. To avoid the nondifferentiablility of the max{} operator, you can use an "epigraph" reformulation:
min p = sum{i in modelin} cdf("Normal", (a + b*zscore[i]));
con y : p / card(modelin) = 0.0008;
var MinMaxVar;
min MinMaxObj = MinMaxVar;
con MinMaxCon {i in modelin}: MinMaxVar >= cdf("Normal", (a + b*zscore[i]));
6. You can avoid the two DATA steps after PROC OPTMODEL by including another CREATE DATA statement:
create data model_applied from [xn]=modelin zscore a b modelled_PD=(cdf("Normal", a + (b*zscore[xn]))*100);
7. The RUN statement is ignored. Use QUIT instead.
8. A PROC SGPLOT call shows that the minimax approach avoids the spikes:
proc sgplot data=model_applied;
series x=xn y=zscore;
series x=xn y=modelled_PD;
yaxis display=(nolabel);
run;
