spc boxChart

Performance Case: Large-Scale Monitoring Across Multiple Production Lines

Scénario de test & Cas d'usage

Business Context

A large pharmaceutical company monitors the purity level of a drug produced across 100 parallel production lines. To manage this scale, they only want to generate charts for lines that exhibit out-of-control behavior. The analysis must be robust enough to handle a high number of distinct processes.
About the Set : spc

Statistical Process Control (control charts).

Discover all actions of spc
Data Preparation

Create a large dataset named 'DrugPurity' with 100 production lines ('LineID'), each having 50 batches. Intentionally introduce an out-of-control point in Line 'L-042' and Line 'L-088'.

Copied!
1DATA mycas.DrugPurity;
2 LENGTH LineID $ 8;
3 DO line = 1 to 100;
4 LineID = 'L-' || put(line, z3.);
5 DO Batch = 1 to 50;
6 DO i = 1 to 5;
7 Purity = 99.5 + 0.1 * rannor(123);
8 /* Introduce specific outliers */
9 IF LineID = 'L-042' and Batch = 30 THEN Purity = 98.9;
10 IF LineID = 'L-088' and Batch = 15 THEN Purity = 100.2;
11 OUTPUT;
12 END;
13 END;
14 END;
15RUN;

Étapes de réalisation

1
Run the boxChart action on the large dataset, grouping by 'LineID'. Use 'exChart=True' to only generate chart data for processes with exceptions. Set a high 'groupByLimit' to ensure all 100 lines are processed.
Copied!
1PROC CAS;
2 spc.boxChart /
3 TABLE={name='DrugPurity', groupBy={'LineID'}},
4 processValue='Purity',
5 subgroupValue='Batch',
6 primaryTests={test1=true},
7 exChart=true,
8 groupByLimit=200,
9 chartsTable={name='PurityExceptions', replace=true};
10RUN;
2
Fetch the results from the 'PurityExceptions' table. The results should only contain data for the lines that had an out-of-control point.
Copied!
1 
2PROC CAS;
3TABLE.fetch / TABLE={name='PurityExceptions'};
4RUN;
5 
3
Verify that only the expected lines are present in the output table by counting the distinct 'LineID' values.
Copied!
1PROC CAS;
2 SIMPLE.distinct /
3 TABLE={name='PurityExceptions'}
4 inputs={{name='LineID'}};
5RUN;

Expected Result


The action should process all 100 lines without hitting a group limit. The resulting 'PurityExceptions' table should be created but should only contain summary data for 'L-042' and 'L-088', as these were the only lines with points outside the 3-sigma limits (failing Test 1). The distinct count on the result table should return 2.