Type : CREATION_INTERNE
La macro opera sobre una cadena de caracteres proporcionada como parámetro ('pth') y no lee datos de tablas SASHELP o fuentes externas. Manipula cadenas de caracteres en memoria para construir el resultado.
| 1 | %macro getFileStem(pth)/des="Extract the path without the file name and extension"; |
| 2 | %local revstr cutstr gotstm; |
| 3 | %let revstr=%qleft(%qsysfunc(reverse(&pth))); |
| 4 | %let cutstr=%qsubstr(&revstr,%qsysfunc(indexc(&revstr,%str(/\)))); |
| 5 | %let gotstm=%qleft(%qsysfunc(reverse(&cutstr))); |
| 6 | %str(&gotstm) |
| 7 | %mend getFileStem; |