In reply to Al Sherkow.

Hi Al, After researching this a bit more here, it turns out that the DLGCDIR function is not designed to return the current working directory in a DATA step variable or macro variable. But the following sample code when run on Windows creates both a DATA step variable and a macro variable that contains the current working directory:

filename curdir pipe 'echo %CD%';

data sasdata;
infile curdir truncover;
length currentdir $ 100;
input currentdir $char100.;
put currentdir=;
call symput('curwdir',currentdir);
run;

%put Current working directory is &curwdir;