From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,f8b5a5e1dbbb6bf X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,f8b5a5e1dbbb6bf X-Google-Attributes: gid1164f8,public From: "Bruce F. Thatcher" Subject: Re: How do you automate a file to run every hour ? Date: 1997/06/12 Message-ID: <01bc774e$f7cea240$6a046e78@bft.spire.com>#1/1 X-Deja-AN: 247914872 References: Organization: Spire Technologies, Inc. Newsgroups: comp.os.vms,comp.sys.dec Yin Tse wrote in article ... > I'm looking into writing a com file to run every hour or so. That com > file will start an application which will run until it terminates. > My question is how do you do that... First, decide whether you want the procedure running in a batch queue (type HELP SUBMIT for more information), or as an independent (detached) process (type HELP RUN PROCESS for more information)? Note that you need specialized privileges to run a process in detached mode. In either case, you have a couple of choices: If the procedure doesn't have to run every hour exactly, you might incorporate the command $ WAIT 01:00:00 into the code. The procedure would run the application, hibernate for an hour, and then (using a GOTO loop) run the application again. Or, you might have the procedure restart itself (using a new SUBMIT or RUN command) at the top of the next hour. I leave the algorithm to determine the next hour to the reader (hint: a modification of f$cvti("+1:"...) is probably easiest ). There are other, more sophisticated methods that you can read about in HELP, but these two should provide an adequate solution. > and also how do you program it in dcl > to let you know if the com file was not able to run the application for > some reason. Is there some way to know that the application crashed or > would not start. Thanks for the help in advance. There is a global symbol called $STATUS that contains the status code resulting from the last image invocation (or certain DCL instructions). By checking this symbol for odd (success) or even (error) after your application terminates, you will know the status of the application's execution. You can check with the command IF $STATUS .AND. 1 THEN... ! Success or IF .NOT. ($STATUS .AND. 1) THEN ... ! Error Note that your DCL procedure can also return a status code by using $ EXIT Hope this helps. =============================================================== To resist the flood of spam on the internet, I have added the string "privacy." to my return address. To contact me, simply remove it. Fight net abuse! Report ALL net abusers to their ISPs! ===============================================================