Type : SASHELP
Los datos de entrada provienen del conjunto de datos interno SASHELP.CLASS, disponible por defecto en SAS.
| 1 | DATA _null_; |
| 2 | SET sashelp.class END=eof; |
| 3 | call symputx(cats('STUDENT',_n_),name); |
| 4 | IF eof THEN call symputx('NUM_STUDENTS',_n_); |
| 5 | RUN; |
| 1 | * Verify the contents of the new macro variables by printing to the SAS log.; |
| 2 | options nosource; |
| 3 | %put ======================; |
| 4 | %put Number of Students: &NUM_STUDENTS; |
| 5 | %put; |
| 6 | %put Student 1: &STUDENT1; |
| 7 | %put Student 2: &STUDENT2; |
| 8 | %put Student 3: &STUDENT3; |
| 9 | %put ...; |
| 10 | %put Student 17: &STUDENT17; |
| 11 | %put Student 18: &STUDENT18; |
| 12 | %put Student 19: &STUDENT19; |
| 13 | %put ======================; |
| 14 | options SOURCE; |