home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!agate!ucbvax!lrw.com!leichter
- From: leichter@lrw.com (Jerry Leichter)
- Newsgroups: comp.os.vms
- Subject: re: DCL: ? Continuing execution after -?- severity message.
- Message-ID: <9301231632.AA16606@uu3.psi.com>
- Date: 23 Jan 93 15:11:22 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Distribution: world
- Organization: The Internet
- Lines: 38
-
-
- What commands to I need to use to insure that a command procedure
- doesn't quit running after any warning/error conditions?
-
- I have a procedure which must run to completion even if one of the
- commands generates a warning/error condition and at the beginning I
- have:
-
- $ ON SEVERE_ERROR THEN CONTINUE
-
- I thought that would cover them all but the procedure terminated
- prematurely after starting (and completing?) a backup recording pass.
-
- Do I need to have "ON" traps for each severity level, or should just
- the highest one catch it?
-
- No; that's a common misconception. The statement:
-
- $ ON level THEN trap
-
- means: If there is an error of severity "level" or greater, execute "trap";
- otherwise, ignore the error. Notice that this definition covers ALL POSSIBLE
- severity levels: Any pre-existing ON statements are effectively overridden.
-
- Your ON statement has ALMOST the effect you want. The problem with it is that
- the action specified by an ON statement is executed only once; then the
- default action (ignore warnings, exit on everything else) is reinstated.
-
- The way to have a command procedure completely ignore error conditions is to
- use the SET NOON statement. After SET NOON, DCL ignores the return status
- of all commands (within this command procedure only, until the next SET ON).
-
- Please respond directly to me since I am not subscribed to this list.
-
- Well, I hope you know someone who'll forward this response to you then,
- because damned if *I* will.
- -- Jerry
-
-