When working with the level="PARTITION" option, be careful with large tables! If a table has thousands of unique partition keys (e.g., partitioning by Customer_ID), the tableDetails output can be overwhelming and clutter your log. Always use the perNode= parameter (as shown in your final example) to limit the output to a manageable number of sample blocks per worker node, ensuring you get a representative snapshot without drowning in data.
Type : CREATION_INTERNE
The examples use CAS tables created directly via DATA steps or 'loadTable' actions to illustrate the functionality without external dependencies.
| 1 | PROC CAS; |
| 2 | /* Crée une table simple en mémoire dans la caslib 'casuser' */ |
| 3 | DATA casuser.simple_data; |
| 4 | INPUT id name $; |
| 5 | DATALINES; |
| 6 | 1 Alice |
| 7 | 2 Bob |
| 8 | 3 Charlie |
| 9 | ; |
| 10 | RUN; |
| 11 | |
| 12 | /* Obtient les détails de base pour la table 'simple_data' */ |
| 13 | TABLE.tableDetails / name="simple_data"; |
| 14 | QUIT; |
| 1 | PROC CAS; |
| 2 | /* Crée une table 'product_info' dans la caslib 'casuser' */ |
| 3 | DATA casuser.product_info; |
| 4 | INPUT product $ price; |
| 5 | DATALINES; |
| 6 | Apple 1.00 |
| 7 | Banana 0.50 |
| 8 | Orange 0.75 |
| 9 | Mango 2.20 |
| 10 | ; |
| 11 | RUN; |
| 12 | |
| 13 | /* Obtient les détails pour 'product_info' en spécifiant explicitement la caslib. */ |
| 14 | /* Utilisation de l'alias 'table' pour le paramètre 'name'. */ |
| 15 | TABLE.tableDetails / |
| 16 | TABLE="product_info", |
| 17 | caslib="casuser"; |
| 18 | QUIT; |
| 1 | PROC CAS; |
| 2 | /* Crée une table plus grande pour simuler la distribution sur plusieurs nœuds */ |
| 3 | DATA casuser.large_transactions; |
| 4 | DO i = 1 to 10000; |
| 5 | region = IF mod(i, 4) = 0 THEN 'North' |
| 6 | ELSE IF mod(i, 4) = 1 THEN 'South' |
| 7 | ELSE IF mod(i, 4) = 2 THEN 'East' |
| 8 | ELSE 'West'; |
| 9 | amount = 100 + ranuni(0) * 1000; |
| 10 | OUTPUT; |
| 11 | END; |
| 12 | RUN; |
| 13 | |
| 14 | /* Obtient les détails par nœud sans inclure les informations mémoire */ |
| 15 | TABLE.tableDetails / |
| 16 | name="large_transactions", |
| 17 | caslib="casuser", |
| 18 | level="NODE", |
| 19 | showMem=FALSE; |
| 20 | QUIT; |
| 1 | PROC CAS; |
| 2 | /* Crée une table avec des données à partitionner */ |
| 3 | DATA casuser.raw_sales; |
| 4 | INPUT Date:yymmdd. Region $ Sales; |
| 5 | FORMAT Date yymmdd10.; |
| 6 | DATALINES; |
| 7 | 2023-01-01 North 100 |
| 8 | 2023-01-01 South 150 |
| 9 | 2023-01-02 East 120 |
| 10 | 2023-01-02 West 180 |
| 11 | 2023-01-03 North 110 |
| 12 | 2023-01-03 South 160 |
| 13 | 2023-01-04 East 130 |
| 14 | 2023-01-04 West 190 |
| 15 | 2023-01-05 North 200 |
| 16 | 2023-01-05 South 210 |
| 17 | 2023-01-06 East 220 |
| 18 | 2023-01-06 West 230 |
| 19 | ; |
| 20 | RUN; |
| 21 | |
| 22 | /* Partitionne la table par la variable 'Region' */ |
| 23 | TABLE.partition / |
| 24 | name="raw_sales", |
| 25 | caslib="casuser", |
| 26 | groupBy={"Region"}, |
| 27 | casOut={name="partitioned_sales_by_region", caslib="casuser", replace=true}; |
| 28 | |
| 29 | /* Obtient les détails par partition, en limitant la sortie à 2 blocs par nœud */ |
| 30 | TABLE.tableDetails / |
| 31 | name="partitioned_sales_by_region", |
| 32 | caslib="casuser", |
| 33 | level="PARTITION", |
| 34 | perNode=2; |
| 35 | QUIT; |
This feature allows user-defined formats to be stored in SAS catalogs or in a format library on t...
This document provides SAS code examples to display information about SAS libraries and their mem...