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 (May 2009, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 13 May 2009 16:07:08 -0700
Reply-To:   "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Subject:   Re: Existence of dos link
In-Reply-To:   A<200905130908.n4CNwxdk010811@malibu.cc.uga.edu>
Content-Type:   text/plain; charset="us-ascii"

Ash007 -

If what you mean by dos link file is a windows shortcut then you will need to specify a ".lnk" extension. If you mean a dynamic-link library then it would be ".dll".

data _null_; ok = fileexist("C:\Users\A\Documents\test_html\1- Cartographie\dossier_bidon.lnk"); put ok=; run;

If you aren't sure about the extension you can use a piped DIR listing or SAS DREAD:

filename dir pipe 'dir /w/b "C:\Users\A\Documents\test_html\1-Cartographie\"'; data _null_; infile dir; input; if upcase("dossier_bidon")=:upcase(_infile_) then put _infile_; run; filename dir;

or

data _null_; attrib FileName length = $72; rc = filename("mydir","C:\Users\A\Documents\test_html\1-Cartographie\"); did = dopen ("mydir"); dim_files = dnum(did); do i = 1 to dim_files; filename = dread(did,i); if upcase("dossier_bidon")=:upcase(filename) then put filename; end; rc = dclose(did); run;

Paul Choate DDS Data Extraction (916) 654-2160

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Gerhard Hellriegel Sent: Wednesday, May 13, 2009 2:08 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Existence of dos link

you can try it with the FILEEXIST function:

data _null_; ok = fileexist("C:\Users\A\Documents\test_html\1- Cartographie\dossier_bidon"); put ok=; run;

Gerhard

On Wed, 13 May 2009 00:59:07 -0700, ash007 <RamsamyAshley@GMAIL.COM> wrote:

>Hello, > >Is there a SAS function which tests the existence of a dos link like >'C:\Users\A\Documents\test_html\1-Cartographie\dossier_bidon'. > >Thanks. > >Ash007.


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