Type : CREATION_INTERNE
Los ejemplos utilizan conjuntos de datos SASHELP (sashelp.cars, sashelp.class, sashelp.quakes, sashelp.comet) o creaciones de datos internas, lo que hace que los ejemplos sean autónomos.
| 1 | LIBNAME mysas "c:\Users\demo"; |
| 2 | DATA cars; |
| 3 | SET sashelp.cars; |
| 4 | keep make mpg MSRP; |
| 5 | Mpg=(MPG_City*.45)+(MPG_Highway*.55)/2; |
| 6 | RUN; |
| 7 | PROC PRINT DATA=cars(obs=10); RUN; |
| 1 | DATA class; |
| 2 | SET sashelp.class; |
| 3 | where age>12 and height>=67; |
| 4 | RUN; |
| 5 | PROC PRINT DATA=class; RUN; |
| 1 | DATA quakes; |
| 2 | SET sashelp.quakes(where=(Magnitude>6.0)); |
| 3 | keep Depth Type Magnitude; |
| 4 | RUN; |
| 5 | PROC PRINT DATA=quakes; RUN; |
| 6 | |
| 7 | DATA quakes2; |
| 8 | SET quakes(firstobs=5); |
| 9 | RUN; |
| 10 | PROC PRINT DATA=quakes2; RUN; |
| 1 | DATA quakes; |
| 2 | SET sashelp.quakes(where=(Magnitude>6.0)); |
| 3 | keep Depth Type Magnitude; |
| 4 | RUN; |
| 5 | PROC PRINT DATA=quakes; RUN; |
| 6 | |
| 7 | DATA quakes2; |
| 8 | SET quakes(firstobs=2 obs=4); |
| 9 | RUN; |
| 10 | PROC PRINT DATA=quakes2; RUN; |
| 1 | PROC PRINT DATA=sashelp.comet(obs=5); |
| 2 | title "Sashelp.Comet Data Set"; |
| 3 | |
| 4 | |
| 5 | RUN; |
| 6 | |
| 7 | DATA comet; |
| 8 | num=3; |
| 9 | SET sashelp.comet point=num; |
| 10 | call symput('num',num); |
| 11 | OUTPUT; |
| 12 | stop; |
| 13 | RUN; |
| 14 | |
| 15 | PROC PRINT DATA=comet; |
| 16 | title "Row &num from Sashelp.Comet Data Set"; |
| 17 | RUN; |