I corrected the inconsistent spellings of probability, and added some code to the step.
Essentially, you hold a value which is the smallest and compare it to the difference.
If difference is lower than smallest then update smallest.
Otherwise it is larger and has started to increase again. So output the record at that point and stop the data step.
You now have one record with the smallest value and related X value.
If you don't like the column names, issue a rename option on the data statement.
Kind regards
David
Data ONE;
SMALLEST = 9999;
Do X = -2.5 To 0 By .05;
PROBABILITY = ProbNorm( X);
DIFFERENCE = ABS( .1 - PROBABILITY);
* the smallest value of difference and its corresponding
x value would be what I want to print out;
If DIFFERENCE < SMALLEST Then Do;
SMALLEST = DIFFERENCE;
XVALUE = X;
End;
Else Do;
Output;
Stop;
End;
End;
Run;