Incorrect limits read with one phase in input data and multiple limits in PROC SHEWHART


In PROC SHEWHART, when READPHASES=ALL and READINDEX=ALL are specified on any chart statement, only one phase is read from the DATA= or HISTORY= data set, and multiple phases exist in the LIMITS= data set, the first observation is always read from the LIMITS= data set. Unless the limits for the single input phase happen to be stored in the first observation, then an incorrect set of limits will be placed on the chart. This will occur when only one phase exists in the input data or if a where clause is used in the procedure to subset one phase from the input data.

There are several ways to circumvent this problem: (1) explicitly specify the value of the _INDEX_ variable on the READINDEX= option, (2) explicitly specify the value of the _PHASE_ variable on the READPHASES= option, or (3) subset the LIMITS= data so that it only contains the observation with the correct limits.