Type : CREATION_INTERNE
Los ejemplos utilizan datos generados (datalines) para crear los conjuntos de datos de entrada 'animal', 'plant', 'animalDupes' y 'plantMissing2'. SASHELP no se utiliza.
| 1 | DATA animal; |
| 2 | INPUT common $ animal$; |
| 3 | DATALINES; |
| 4 | a Ant |
| 5 | b Bird |
| 6 | c Cat |
| 7 | d Dog |
| 8 | e Eagle |
| 9 | f Frog |
| 10 | ; |
| 11 | RUN; |
| 12 | |
| 13 | DATA plant; |
| 14 | INPUT common $ plant$; |
| 15 | DATALINES; |
| 16 | a Apple |
| 17 | b Banana |
| 18 | c Coconut |
| 19 | d Dewberry |
| 20 | e Eggplant |
| 21 | f Fig |
| 22 | ; |
| 23 | RUN; |
| 24 | |
| 25 | PROC SORT DATA=animal; BY common; RUN; |
| 26 | PROC SORT DATA=plant; BY common; RUN; |
| 27 | |
| 28 | DATA interleave; |
| 29 | SET animal plant; |
| 30 | BY common; |
| 31 | RUN; |
| 32 | PROC PRINT DATA=interleave; RUN; |
| 1 | DATA animalDupes; |
| 2 | INPUT common $ animal$; |
| 3 | DATALINES; |
| 4 | a Ant |
| 5 | a Ape |
| 6 | b Bird |
| 7 | c Cat |
| 8 | d Dog |
| 9 | e Eagle |
| 10 | ; |
| 11 | RUN; |
| 12 | |
| 13 | DATA plantDupes; |
| 14 | INPUT common $ plant$; |
| 15 | DATALINES; |
| 16 | a Apple |
| 17 | b Banana |
| 18 | c Coconut |
| 19 | c Celery |
| 20 | d Dewberry |
| 21 | e Eggplant |
| 22 | ; |
| 23 | RUN; |
| 24 | |
| 25 | PROC SORT DATA=animalDupes; BY common; RUN; |
| 26 | PROC SORT DATA=plantDupes; BY common; RUN; |
| 27 | |
| 28 | DATA interleave; |
| 29 | SET animalDupes plantDupes; |
| 30 | BY common; |
| 31 | RUN; |
| 32 | |
| 33 | PROC PRINT DATA=interleave; RUN; |
| 1 | DATA animalDupes; |
| 2 | INPUT common $ animal$; |
| 3 | DATALINES; |
| 4 | a Ant |
| 5 | a Ape |
| 6 | b Bird |
| 7 | c Cat |
| 8 | d Dog |
| 9 | e Eagle |
| 10 | ; |
| 11 | RUN; |
| 12 | |
| 13 | DATA plantDupes; |
| 14 | INPUT common $ plant$; |
| 15 | DATALINES; |
| 16 | a Apple |
| 17 | b Banana |
| 18 | c Coconut |
| 19 | c Celery |
| 20 | d Dewberry |
| 21 | e Eggplant |
| 22 | ; |
| 23 | RUN; |
| 24 | |
| 25 | PROC SORT DATA=animalDupes; BY common; RUN; |
| 26 | PROC SORT DATA=plantDupes; BY common; RUN; |
| 27 | |
| 28 | DATA interleave; |
| 29 | SET plantDupes animalDupes; BY common; |
| 30 | RUN; |
| 31 | PROC PRINT DATA=interleave; RUN; |
| 1 | DATA animalDupes; |
| 2 | INPUT common $ animal$; |
| 3 | DATALINES; |
| 4 | a Ant |
| 5 | a Ape |
| 6 | b Bird |
| 7 | c Cat |
| 8 | d Dog |
| 9 | e Eagle |
| 10 | ; |
| 11 | RUN; |
| 12 | |
| 13 | DATA plantMissing2; |
| 14 | INPUT common $ plant$; |
| 15 | DATALINES; |
| 16 | a Apple |
| 17 | b Banana |
| 18 | c Coconut |
| 19 | e Eggplant |
| 20 | f Fig |
| 21 | ; |
| 22 | RUN; |
| 23 | |
| 24 | PROC SORT DATA=animalDupes; BY common; RUN; |
| 25 | PROC SORT DATA=plantMissing2; BY common; RUN; |
| 26 | |
| 27 | DATA interleave; |
| 28 | SET animalDupes plantMissing2; |
| 29 | BY common; |
| 30 | RUN; |
| 31 | |
| 32 | PROC PRINT DATA=interleave; RUN; |