Prev: Common Programming Mistake with Proc Sort NODUPRECS
Next: Test exercises for someone learning SAS
From: Yat John Pang on 2 Dec 2009 12:00 Hi all, I have the following sas challenge (9.1.3). Hopefully someone dealt with this problem before. I want to check if an excel file exists on webdav before I get the file over to the workspace. I have tried the filename (sasxbamw) then use fexist. But somehow the return code is always 1 (even it does not exists). Does anyone know how to check whether it exists (with sas code) without generating a hard error? Thanks in advance.
From: Gerhard Hellriegel on 2 Dec 2009 12:48 hmm, did you try it with fileexist without a filename? Like: x=fileexist("the_file"); Gerhard On Wed, 2 Dec 2009 09:00:33 -0800, Yat John Pang <y.j.pang(a)GMAIL.COM> wrote: >Hi all, I have the following sas challenge (9.1.3). Hopefully someone >dealt with this problem before. I want to check if an excel file >exists on webdav before I get the file over to the workspace. > >I have tried the filename (sasxbamw) then use fexist. But somehow the >return code is always 1 (even it does not exists). > >Does anyone know how to check whether it exists (with sas code) >without generating a hard error? > >Thanks in advance.
From: Yat John Pang on 2 Dec 2009 15:50 On 2 dec, 17:48, gerhard.hellrie...(a)T-ONLINE.DE (Gerhard Hellriegel) wrote: > hmm, did you try it with fileexist without a filename? > > Like: > > x=fileexist("the_file"); > > Gerhard > > On Wed, 2 Dec 2009 09:00:33 -0800, Yat John Pang <y.j.p...(a)GMAIL.COM> > wrote: > > >Hi all, I have the following sas challenge (9.1.3). Hopefully someone > >dealt with this problem before. I want to check if an excel file > >exists on webdav before I get the file over to the workspace. > > >I have tried the filename (sasxbamw) then use fexist. But somehow the > >return code is always 1 (even it does not exists). > > >Does anyone know how to check whether it exists (with sas code) > >without generating a hard error? > > >Thanks in advance. Thanks for your reply. I did not try that option, because the file is on the webdav, which you have to provide your username and p/w with the filename. Actually after some trail and error it seems like the fopen within a data step does give a correct return code. So this will solve this. As I can open it, I know it exists.
|
Pages: 1 Prev: Common Programming Mistake with Proc Sort NODUPRECS Next: Test exercises for someone learning SAS |