Understanding default libraries is fundamental to managing your session’s data lifecycle. SAS uses a two-level naming convention (libref.filename). If you omit the first level (e.g., DATA MyTable;), SAS defaults to a specific storage location based on your environment configuration. Mastery of these defaults ensures you don't accidentally lose data or clutter shared resources.
Type : CREATION_INTERNE
The examples in this documentation reference default SAS libraries (Sashelp) or describe the management of temporary and permanent data, but do not provide SAS code examples directly in this segment. Code examples for data creation or table usage will be extracted from related sections if available.
| 1 | /* Ce code crée une table temporaire 'MyTempTable' dans la bibliothèque Work. */ |
| 2 | DATA MyTempTable; |
| 3 | INPUT ID Name $; |
| 4 | DATALINES; |
| 5 | 1 John |
| 6 | 2 Jane |
| 7 | ; |
| 8 | RUN; |
| 9 | |
| 10 | PROC PRINT DATA=MyTempTable; |
| 11 | RUN; |
| 1 | /* Assigne la bibliothèque User à un dossier pour le stockage permanent. */ |
| 2 | LIBNAME User '/sas/data/user_lib'; /* Remplacez par votre chemin réel */ |
| 3 | |
| 4 | /* Crée une table permanente 'MyPermanentTable' dans la bibliothèque User. */ |
| 5 | DATA MyPermanentTable; |
| 6 | INPUT Product $ Quantity; |
| 7 | DATALINES; |
| 8 | Apple 100 |
| 9 | Orange 150 |
| 10 | Banana 200 |
| 11 | ; |
| 12 | RUN; |
| 13 | |
| 14 | PROC PRINT DATA=MyPermanentTable; |
| 15 | RUN; |
| 16 | |
| 17 | /* Si la bibliothèque User est assignée, SAS cherchera 'MyPermanentTable' ici. */ |
| 18 | /* Pour créer une table temporaire explicitement dans Work, utilisez un nom à deux niveaux. */ |
| 19 | DATA Work.AnotherTempTable; |
| 20 | INPUT Item $ Price; |
| 21 | DATALINES; |
| 22 | Pen 1.50 |
| 23 | Paper 3.00 |
| 24 | ; |
| 25 | RUN; |
| 26 | |
| 27 | PROC PRINT DATA=Work.AnotherTempTable; |
| 28 | RUN; |
| 1 | /* Liste le contenu de la bibliothèque Sashelp. */ |
| 2 | PROC CONTENTS DATA=Sashelp._ALL_ NODS; |
| 3 | RUN; |
| 4 | |
| 5 | /* Affiche les 5 premières lignes de la table 'CLASS' de Sashelp. */ |
| 6 | PROC PRINT DATA=Sashelp.Class(OBS=5); |
| 7 | RUN; |
| 1 | /* Liste le contenu du catalogue Sasuser.Profile. */ |
| 2 | PROC CATALOG CATALOG=Sasuser.Profile ENTRYTYPE=ALL; |
| 3 | CONTENTS; |
| 4 | RUN; |
FedSQL is a proprietary SAS implementation of the ANSI SQL:1999 standard, offering scalable, mult...
This document describes the default SAS libraries (Work, User, Sashelp, Sasuser) provided by SAS,...
This document explains how SAS engines manage access and processing of data files in the SAS Comp...
This document describes the characteristics of SAS engines, including a summary of commonly used ...
This document defines what a SAS data set is, its components (data and metadata), and how it is s...