Hi @fanfanpao , one another thing which came into my mind, if you know the "wanted" starting location in advance, would be use of DLGCDIR() function, to change current working directory, like in the example: %put *%sysfunc(pathname(WORK))*;
%put *%sysfunc(DLGCDIR(%sysfunc(pathname(WORK))))*;
filename test "."; /*fileref to working dir*/
filename test list;
filename test clear; which in my case gave: 1
2 %put *%sysfunc(pathname(WORK))*;
*C:\SAS_Temporary_Files\_TD4300_H48LBFI12PS0510_*
3 %put *%sysfunc(DLGCDIR(%sysfunc(pathname(WORK))))*;
NOTE: The current working directory is now "C:\SAS_Temporary_Files\_TD4300_H48LBFI12PS0510_".
*0*
4
5 filename test "."; /*fileref to working dir*/
6 filename test list;
NOTE: Fileref= TEST
Physical Name= C:\SAS_Temporary_Files\_TD4300_H48LBFI12PS0510_
7 filename test clear;
NOTE: Fileref TEST has been deassigned. One disadvantage, it requires SAS 9.4M5 (or 4) to work. All the best Bart
... View more