Scénario de test & Cas d'usage
Simulation von 100.000 Sensor-Log-Einträgen mit Maschinengruppen.
| 1 | DATA casuser.sensor_logs; |
| 2 | DO i=1 to 100000; |
| 3 | machine_id = mod(i, 5); |
| 4 | temperature = 50 + 10*rand('normal'); |
| 5 | pressure = 100 + 20*rand('normal') + (temperature * 0.5); |
| 6 | vibration = rand('uniform'); |
| 7 | OUTPUT; |
| 8 | END; |
| 9 | RUN; |
| 1 | PROC CAS; |
| 2 | SIMPLE.correlation / |
| 3 | TABLE={name='sensor_logs', groupBy={{name='machine_id'}}} |
| 4 | inputs={{name='temperature'}, {name='pressure'}} |
| 5 | varianceDivisor='N' |
| 6 | groupByLimit=100 |
| 7 | outputTables={names={'corr_by_machine'}}; |
| 8 | RUN; |
Die Aktion verarbeitet die 100.000 Zeilen effizient und liefert separate Korrelationsmatrizen für jede `machine_id`. Der Divisor 'N' wird für die Varianzberechnung verwendet.