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 (November 2001, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 21 Nov 2001 13:25:34 -0500
Reply-To:   Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Subject:   Re: Rsubmit: How can you program to check for filename error?

I think you will not be lucky with the FILEXIST function, because it might return a value which you don't want, if the file exists, but is allocated to another job or user! For that you should better try to use the filename function together with the open-function. With that you can try if the file can be opened in the mode you need. E.g. if you want to delete or update it, also a SHR access of another user is a showstopper, not so if you are only reading it! With the open function you can try to open it with the mode you need and test for the result. Don't forget to close it, before you start your job, otherwise you are blocking the dataset with your SAS online-session. Also it should be very fast, that you submit your job after sucessfully testing, because if another job is waiting for that dataset it will run as soon as it is available. I don't know, how you can avoid that...

By the way: many of the SCL-functions are also usable in BASE SAS, so you do not need AF for that.

On Wed, 21 Nov 2001 09:27:41 -0800, Meredith Clark <clarkmeredith@YAHOO.COM> wrote:

>There's a fileexist function in scl you can use. I >don't use the mainframe, so I can't help you with >waiting to resubmit, but the syntax is as follows: > >data _null_; >filnm='c:\temp\myfile.dat'; >rc=fileexist(filnm); >run; > >rc=1 if it exists, 0 if it doesn't. >HTH >Meredith > > >--- Mark Mullins <mlmullins@BBANDT.COM> wrote: >> I use PC SAS 8.2 and use Rsubmit against 8.2 on >> OS/390. In the >> mainframe world when I submit a batch program, my >> program is put into >> a queue, then runs when files are available. These >> jobs do not try to >> run when files are unavailable. Can I duplicate the >> queue when doing >> rsubmit from PC SAS? Or, can I check to see that a >> filename statement >> did not contain errors? See error example below: >> >> 13 FILENAME CUSTMAST 'G060.CL890.BM.CUST2(0)' >> DISP=SHR; >> ERROR: SVC99 error rc=4, reason=0220 : IKJ56221I >> DATA SET >> G060.CL890.BM.CUST2 NOT ALLOCATED, VOLUME NOT >> AVAILABLE+IKJ56221I >> VOLUME IS ALLOCATED TO ANOTHER JOB OR USER, TRY >> LATER. >> ERROR: Error in the FILENAME statement. >> 14 * CUST MASTER - LIVE FILE; >> 15 *** FILENAME CUSTMAST 'O060.CL000.CUST.MAST' >> DISP=SHR; >> 16 * NOTE EXTENS - PREVIOUS MONTH FILE; >> 17 FILENAME NOTEEXT 'G060.CL890.BM.NOTE.EXT2(0)' >> DISP=SHR; >> ERROR: SVC99 error rc=4, reason=0220 : IKJ56221I >> DATA SET >> G060.CL890.BM.NOTE.EXT2 NOT ALLOCATED, VOLUME NOT >> AVAILABLE+IKJ56221I >> VOLUME IS ALLOCATED TO ANOTHER JOB OR USER, TRY >> LATER. >> ERROR: Error in the FILENAME statement. >> 18 >> >> So in essence, I would like to program something >> that says ' If >> FILENAME CUSTMAST is not available or is allocated >> to another user, >> then wait 30 minutes and try again or halt program. >> Today, the >> program continues to run, then I find out when it is >> done that there >> are no records to download.... Valuable help greatly >> appreciated! >> >> Mark L. Mullins >> BB&T Small Business Systems Manager >> 336.733.3425 >> mailto:MLMullins@BBandT.com > > >__________________________________________________ >Do You Yahoo!? >Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. >http://geocities.yahoo.com/ps/info1


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