Scénario de test & Cas d'usage
Simulation of a high-volume sensor dataset (100,000 rows) with random vibration readings.
| 1 | |
| 2 | DATA casuser.raw_sensors; |
| 3 | call streaminit(999); |
| 4 | DO k = 1 to 100000; |
| 5 | Sensor_ID = floor(rand('Uniform') * 50); |
| 6 | Timestamp = datetime(); |
| 7 | Vibration = rand('Normal'); |
| 8 | OUTPUT; |
| 9 | END; |
| 10 | |
| 11 | RUN; |
| 12 |
| 1 | |
| 2 | PROC CAS; |
| 3 | TABLE.copyTable / TABLE={name='raw_sensors', caslib='casuser'}, casout={name='sensor_archive_global', caslib='casuser', compress=true, indexVars={'Sensor_ID'}, promote=true, replace=true}, distributeRows=true; |
| 4 | |
| 5 | RUN; |
| 6 |
| 1 | |
| 2 | PROC CAS; |
| 3 | TABLE.tableDetails / name='sensor_archive_global' caslib='casuser'; |
| 4 | |
| 5 | RUN; |
| 6 |
The 'sensor_archive_global' table is created with a visible compression ratio in the details. The table is promoted (Global scope), rows are balanced across nodes, and the 'Sensor_ID' column is indexed for fast lookups.