lways use the NOLIST option in production environments to keep your SAS Log clean and focused on errors or warnings. Furthermore, remember that creating an index with the UNIQUE option will cause the procedure to fail if duplicates already exist, making it an excellent "last line of defense" for data quality.
Type : CREATION_INTERNE
Examples use generated data (datalines).
| 1 | options pagesize=40 linesize=80 nodate pageno=1 SOURCE; |
| 2 | |
| 3 | LIBNAME health 'SAS-library'; |
| 4 | |
| 5 | /* Création de jeux de données fictifs pour l'exemple */ |
| 6 | DATA health.group; |
| 7 | INPUT lname $ birth :date7. salary; |
| 8 | FORMAT birth date7.; |
| 9 | DATALINES; |
| 10 | Smith 01JAN80 50000 |
| 11 | Jones 15MAR85 60000 |
| 12 | Brown 20APR75 55000 |
| 13 | ;RUN; |
| 14 | |
| 15 | DATA health.oxygen; |
| 16 | INPUT oxygen; |
| 17 | DATALINES; |
| 18 | 10 |
| 19 | 12 |
| 20 | 11 |
| 21 | ;RUN; |
| 22 | |
| 23 | PROC DATASETS library=health nolist; |
| 24 | modify group (label='Test Subjects' read=green sortedby=lname); |
| 25 | index create vital=(birth salary) / nomiss unique; |
| 26 | informat birth date7.; |
| 27 | FORMAT birth date7.; |
| 28 | label salary='current salary excluding bonus'; |
| 29 | modify oxygen; |
| 30 | rename oxygen=intake; |
| 31 | label intake='Intake Measurement'; |
| 32 | QUIT; |
| 33 |
