Date: Wed, 17 Nov 2004 14:50:14 +1100
Reply-To: Scott <usenet739_yahoo_com_au@CRONKITE.CC.UGA.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Scott <usenet739_yahoo_com_au@CRONKITE.CC.UGA.EDU>
Subject: Re: Last modified date of external file
Thanks Harry, I'll look at those links.
It gets worse: I need both the date and time the files were last modified.
The output from "dir" changes based on the user's regional settings, i.e
yy/mm/dd vs. mm/dd/yy, etc. And I can't expect all my users' PCs to have
the same regional settings.
I could get the data in a portable manner if my pipe was to a PERL script,
but again I can't expect all my users to have PERL installed on their
laptop.
Does anyone know a cscript command/script that returns file information in a
standard format regardless of regional settings? Probably a question best
asked in another newsgroup ;) Or any other bright ideas?
And yes, my preference would be for SAS to surface the information it
already knows in a manner in which I could use it programatically, esp.
since that would be portable to both Windoze and Unix.
Cheers,
Scott
"Harry Droogendyk" <harry.droogendyk@RBC.COM> wrote in message
news:0E5377DC9E9CE34C98D7CDA4EE29154A010C57A8@SEW01070.maple.fg.rbc.com...
> Scott:
>
> Methinks you're beat like a melonhead. SAS doesn't surface that
> information
> for Windoze user consumption. The finfo() stuff is one area where SAS has
> failed to implement code that's transportable across operating systems if
> Windoze is one of the O/S involved.
>
> Searching for a silver lining, I don't see dealing with the 12/24 clock
> differences on user PCs to be a show-stopper. Presumably 24 hour clock
> times are not followed by 'a' or 'p'.
>
> Search SAS-L for 'modulen' or see
> http://www.devenezia.com/downloads/sas/sascbtbl/index.html for Windoze
> stuff
> a tad fancier than "dir".
>
>
> -----Original Message-----
> From: Scott [mailto:usenet739_yahoo_com_au@CRONKITE.CC.UGA.EDU]
> Sent: Tuesday, November 16, 2004 6:46 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Last modified date of external file
>
>
> SAS v8.2, Windows 2000
>
> Hi,
>
> I need to get the last modified date of an external file (Excel
> spreadsheet), compare it to the last modified date of a SAS dataset, and
> process accordingly.
>
> If I do:
>
> filename foo "C:\my excel file.xls";
>
> then view the General Properties of "foo" from SAS Explorer, I see that
> SAS
> is aware of the Last Modified date of this file.
>
> Does SAS surface this information in a way that can be read in a datastep
> or
> macro?
>
> When I run this example code from the online doc (FINFO function):
>
> data info;
> length infoname infoval $60;
> drop rc fid infonum i close;
> rc=filename('abc','physical-filename');
> fid=fopen('abc');
> infonum=foptnum(fid);
> do i=1 to infonum;
> infoname=foptname(fid,i);
> infoval=finfo(fid,infoname);
> output;
> end;
> close=fclose(fid);
> run;
>
> It only returns the information from the "Engine/Host Information"
> dropdown
> list.
>
> I'm aware of using filename foo pipe "dir /t:w <path>", then processing
> that
> information. However, region settings on the PC (i.e. 12 vs. 24 hour
> time)
> affect the output of dir. Plus this code could be ported to other
> platforms
> in the future. I was hoping there was a portable way to get the
> information
> that SAS already knows about (from the General Properties window) into a
> datastep or macro variable.
>
> Thanks,
> Scott
>
> ------------------------------------------------------------
>
> This e-mail may be privileged and/or confidential, and the sender does not
> waive any related rights and obligations. Any distribution, use or copying
> of this e-mail or the information it contains by other than an intended
> recipient is unauthorized. If you received this e-mail in error, please
> advise me (by return e-mail or otherwise) immediately.
>
> Ce courrier électronique est confidentiel et protégé. L'expéditeur ne
> renonce pas aux droits et obligations qui s'y rapportent. Toute diffusion,
> utilisation ou copie de ce message ou des renseignements qu'il contient
> par une personne autre que le (les) destinataire(s) désigné(s) est
> interdite. Si vous recevez ce courrier électronique par erreur, veuillez
> m'en aviser immédiatement, par retour de courrier électronique ou par un
> autre moyen.
>
> ============================================================
|