Date: Wed, 24 May 2006 10:06:46 -0400
Reply-To: Jim Groeneveld <jim2stat@YAHOO.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jim Groeneveld <jim2stat@YAHOO.CO.UK>
Subject: Re: Seraching for a file using SAS
Content-Type: text/plain; charset=ISO-8859-1
Hi Urvir,
Depends on what kind of file:
1. a SAS dataset: macro code (from within a macro):
%IF ( %SYSFUNC ( EXIST ( &LibName.&DataSet ) ) ) %THEN .........
2. any (text/data/excel) file in the DOS/Windows OS (from within a macro):
%IF ( %SYSFUNC ( FILEEXIST(&Dir.&FileName.&Ext) ) ) %THEN .........
Both SAS (?) SCL (?) functions (called via macro function %SYSFUNC) yield 1
if the file exists and 0 if not.
Regards - Jim.
--
Jim Groeneveld, Netherlands
Statistician, SAS consultant
home.hccnet.nl/jim.groeneveld
On Wed, 24 May 2006 06:51:35 -0700, urbunti <urbunti@YAHOO.COM> wrote:
>Hi,
>
> I want to customize my code in a way that if a particular file exist then
only a piece of code will work.
>
> Can anyone help me for this.
>
> Regards,
> Urvir
>
>
>
>---------------------------------
>How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.
|