LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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?
Comments:   To: sas-l@uga.edu
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


Back to: Top of message | Previous page | Main SAS-L page