Two EG sessions should have two different work spaces. I don't think this would explain different results from two different Shewhart runs on the same data.
Missing values of MPIN does not sound normal, unless perhaps if there are missing values of MPIN in the source data?
I suppose it's possible each time you re-query the database, you may be getting records in a different order. SQL doesn't care about order, if you don't specify an order.
If you don't sort by YEARMO, what does your log look like? I ran below code:
proc sort data=sashelp.prdsale out=mysale;
by country;
run;
proc shewhart data=mysale;
by country;
xschart actual*year/nochart outtable=myout;
id prodtype;
run;
And I get errors in the log because it is not sorted by year:
ERROR: The values of the subgroup variable YEAR are not sorted in increasing order in the
data set MYSALE.
NOTE: Recommended practice is to sort the data by the subgroup variable (within BY groups
if any) with PROC SORT.
... View more