| Date: | Tue, 14 Aug 2007 15:39:19 -0700 |
| Reply-To: | wlv@AIR.ORG |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | wlv@AIR.ORG |
| Organization: | http://groups.google.com |
| Subject: | Can DREAD read the currently opened file? |
|
| Content-Type: | text/plain; charset="iso-8859-1" |
|---|
Hello there--
I tried to use Dopen and Dread to read ALL(including the currently
opened files), but it failed. For example, under this path, there are
3 files:
E:\projects\fileA.txt
E:\projects\fileB.cvs
E:\projects\fileC.txt
If I already opened fileB.cvs, my codes below cannot include the fileB
info in the output data set:
filename dir "E:\projects\";
data files;
length file $100 extension $10 form $10;
did=dclose('dir');
did=dopen('dir');
do i = 1 to dnum(did);
file=dread(did,i);
extension=lowcase(reverse(scan(reverse(file),1,'.')));
fid=mopen(did,file);
if fid then do;
rc=fclose(fid);
output;
end;
end;
rc=dclose(did);
run;
Is there any alternative solution to help me complete this mission?
Thanks in advance!
-Wendy
|