Shankar,
I agree that those more familiar with EG might have a better response.
One brute force method would be to use a unnamed pipe. The following article mentions what you would have to do to use a pipe in EG:
http://www.hollandnumerics.co.uk/pdf/Using_EG_4.1(paper).pdf
And, with a pipe you can run a dos dir command and simply parse out what you need. E.g.,
[pre]
filename fnames pipe "dir c:\art\*.txt";
data have;
infile fnames;
informat date mmddyy10.;
informat time time8.;
informat fsize comma12.;
informat fname $32.;
input;
date = input(scan(_infile_,1," "), ?? mmddyy10.);
if not missing(date) then do;
time=input(scan(substr(_infile_,13),1," "), time8.);
fsize=input(scan(substr(_infile_,25),1," "), comma12.);
fname=input(scan(substr(_infile_,40),1," "), $32.);
output;
end;
run;
proc sort data=have;
by descending date descending time;
run;
data want;
set have (obs=1);
run;
[/pre]
HTH,
Art
---------
> Hi Everyone
>
> I am using SAS Enterprise Guide in windows XP
> environment.
>
> As part of my automation work, I need to pick the
> latest .txt file from a list of different files in a
> folder and then do some operations on that.
>
> Is there any way in SAS which I can use to do this?
>
> Request your help.
>
> Thanks
> Shankar