home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 21865 < prev    next >
Encoding:
Internet Message Format  |  1993-01-24  |  1.8 KB

  1. Path: sparky!uunet!stanford.edu!agate!ucbvax!lrw.com!leichter
  2. From: leichter@lrw.com (Jerry Leichter)
  3. Newsgroups: comp.os.vms
  4. Subject: re: DCL: ? Continuing execution after -?- severity message.
  5. Message-ID: <9301231632.AA16606@uu3.psi.com>
  6. Date: 23 Jan 93 15:11:22 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: world
  9. Organization: The Internet
  10. Lines: 38
  11.  
  12.  
  13.     What commands to I need to use to insure that a command  procedure
  14.     doesn't quit running after any warning/error conditions?
  15.  
  16.     I have a procedure which must run to completion even if one of  the
  17.     commands generates a warning/error condition and at the  beginning I
  18.     have:
  19.  
  20.     $ ON SEVERE_ERROR THEN CONTINUE
  21.  
  22.     I thought that would cover them all but the procedure terminated
  23.     prematurely after starting (and completing?) a backup recording pass.
  24.  
  25.     Do I need to have "ON" traps for each severity level, or should  just
  26.     the highest one catch it?
  27.  
  28. No; that's a common misconception.  The statement:
  29.  
  30.     $ ON level THEN trap
  31.  
  32. means:  If there is an error of severity "level" or greater, execute "trap";
  33. otherwise, ignore the error.  Notice that this definition covers ALL POSSIBLE
  34. severity levels:  Any pre-existing ON statements are effectively overridden.
  35.  
  36. Your ON statement has ALMOST the effect you want.  The problem with it is that
  37. the action specified by an ON statement is executed only once; then the
  38. default action (ignore warnings, exit on everything else) is reinstated.
  39.  
  40. The way to have a command procedure completely ignore error conditions is to
  41. use the SET NOON statement.  After SET NOON, DCL ignores the return status
  42. of all commands (within this command procedure only, until the next SET ON).
  43.  
  44.     Please respond directly to me since I am not subscribed to this list.
  45.  
  46. Well, I hope you know someone who'll forward this response to you then,
  47. because damned if *I* will.
  48.                             -- Jerry
  49.  
  50.