Date: Mon, 10 Nov 2003 14:45:05 -0800
Reply-To: cassell.david@EPAMAIL.EPA.GOV
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "David L. Cassell" <cassell.david@EPAMAIL.EPA.GOV>
Subject: Re: Windows Directory Utility
Content-type: text/plain; charset=US-ASCII
"Groeneveld, Jim" <jim.groeneveld@VITATRON.COM> replied (last week):
> And even after a working DIR command in a PIPE it may be dependent on
the OS (e.g. W95/98 vs. NT/2K) where the default output format
significantly differs. W2K offers the "old" format via the /-N option,
but then it does not include both short and long names at the same time
(as W98 does).
Windows is not the only OS guilty of changes in the display
characteristics
of basic tools like this. Consider how things changed when Sun went
from
SunOS to Solaris, and changed the *type* of unix underneath. Berkeley
Unix
and ATT Unix are different enough to break a *lot* of parsing programs
like
this.
For these reasons (among others) I usually recommend getting the desired
info from something more reliable and less parsing-dependent than DIR or
LS. There have been SAS-L posts and SUGI papers on doing this using the
win32 API. (The names which pop into my cranium are Richard DeVenezia
and
Peter Crawford, but I might be overlooking another important SAS guru
here.)
My personal preference is to surface the subtending information using
Perl, and pipe the results into the data step using FILENAMR PIPE .
David
--
David Cassell, CSC
Cassell.David@epa.gov
Senior computing specialist
mathematical statistician