Type : CREATION_INTERNE
El script define únicamente una lógica de programación (macro) sin acceder a datos específicos durante su compilación.
| 1 | *m204d08b; |
| 2 | |
| 3 | %macro wherobs(dsn,mywhere); |
| 4 | %IF %superq(mywhere)= %THEN %DO; |
| 5 | %numobs(&dsn) |
| 6 | %return; |
| 7 | %END; |
| 8 | %local dsid rc; |
| 9 | %let dsid=%sysfunc(open(&dsn(where=(&mywhere)))); |
| 10 | %IF &dsid>0 %THEN %DO; |
| 11 | %sysfunc(attrn(&dsid,nlobsf)) |
| 12 | %let rc=%sysfunc(close(&dsid)); |
| 13 | %END; |
| 14 | %ELSE %put ERROR: Could not open dataset %upcase(&dsn).; |
| 15 | %mend wherobs; |