| Date: | Tue, 24 Aug 1999 10:08:22 -0400 |
| Reply-To: | Bernard Tremblay <bernard@CAPITALE.QC.CA> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
|
| From: | Bernard Tremblay <bernard@CAPITALE.QC.CA> |
| Organization: | Imaginasys enr. |
| Subject: | Re: Question : Get external file size |
|
| Content-Type: | text/plain; charset=us-ascii |
Savvas Velissaris wrote:
>
> Hi there,
>
> I've been looking for a way to get the size of an
> external file in NT Windows. Is there a SAS function
> that could be helpful ?
>
> Savvas
Hi Savvas,
I can't test on NT but the following program gives the info your want
in a
SAS dataset. Just try it on NT and find out the infoname of the file
size. You will
then be able to use it in any datastep and obtain what you're looking
for.
Here is the sample program:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
data info;
length infoname infoval $60;
rc=filename('abc','/home/bernard/bttoc'); /**<=== your file name***/
fid=fopen('abc');
infonum=foptnum(fid);
do i=1 to infonum;
infoname=foptname(fid,i);
infoval=finfo(fid,infoname);
output;
end;
close=fclose(fid);
drop rc fid infonum i close;
run;
options ls=80 ps=59 pageno=1;
proc print ;
title 'Informations from SunOS file system';
run;
~~~~~~~~~~~~Here is the output: ~~~~~~~~~~~~~~~~~~~~~~~~~
Informations from SunOS file
system 1
08:34 Tuesday, August
17, 1999
OBS INFONAME INFOVAL
1 File Name /home/bernard/bttoc
2 Owner Name bernard
3 Group Name cap
4 Access Permission rw-rw-r--
5 File Size (bytes) 3640
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Regards,
Bernard Tremblay
--
\\\|///
\\ - - //
( @ @ )
+-----oOOo-(_)-oOOo-------+--------------------------------------+
| Bernard Tremblay | |
| La Capitale | Tel: (418) 646-2401 |
| | Fax: (418) 646-5960 |
| | Int: Bernard.Tremblay@capitale.qc.ca |
+-------------------------+--------------------------------------+
| Imaginasys enr | Res: (418) 658-1411 |
| | Int: bertrem@quebectel.com |
+--------------Oooo-------+--------------------------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|