home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / bit / listserv / sasl / 4978 < prev    next >
Encoding:
Text File  |  1992-11-09  |  2.2 KB  |  69 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!stanford.edu!unixhub!fnnews.fnal.gov!overload.lbl.gov!zeus.ieee.org!europa.asd.contel.com!paladin.american.edu!auvm!MILLERSV.BITNET!BWALTON
  3. Message-ID: <SAS-L%92110911202183@OHSTVMA.ACS.OHIO-STATE.EDU>
  4. Newsgroups: bit.listserv.sas-l
  5. Date:         Mon, 9 Nov 1992 11:20:36 ET
  6. Reply-To:     BWALTON@MILLERSV.BITNET
  7. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  8. From:         BWALTON@MILLERSV.BITNET
  9. Subject:      Division by zero
  10. Lines: 57
  11.  
  12. CONTENT : Response
  13. SUMMARY : Results of division by zero under different versions of SAS
  14. REL/PLTF : SAS 5.18, 6.06, 6.07 under VM/ESA
  15. E-ADDR : BWALTON@MILLERSV (BITNET)
  16. NAME : Barry Walton
  17. ADDRESS : P.O. Box 1002 Millersville PA 17551-0302
  18. PHONE : (717) 872-3667
  19.  
  20. Recently, SUMA @ CLEMSON asked about what happens when SAS encounters
  21. a division by zero.  This problem cropped up here about a year or so
  22. ago, and I think I mentioned it to the list at that time.  I set up
  23. a small program to create a 10 item data set, with a division by
  24. zero about halfway through:
  25. * CHECK FOR DIVIDE BY ZERO ;
  26. DATA CC;
  27. INPUT X Y;
  28. Z = X/Y;
  29. CARDS;
  30. 1 1
  31. 2 1
  32. 1 2
  33. 1 0   <--- Division by zero
  34. 3 3
  35. 4 2
  36. 2 4
  37. 3 4
  38. 3 1
  39. 1 3
  40. ;
  41. PROC PRINT DATA = CC;
  42. ENDSAS;
  43.  
  44. What happens (under VM/ESA) depends upon which version of SAS one
  45. is using.
  46.  
  47. Under Rel. 5.18 one gets a message in the SAS log that says "Note :
  48. division by zero at line 4 column 6".  The data set (as displayed
  49. with PROC PRINT) contains all 10 obs, with the quotent (Z) set to
  50. missing for the 'bad' obs (the one with the division by zero).
  51.  
  52. Under Rel. 6.06 the log contains the message "Note : the data step has
  53. been abnormally terminated", AND ONLY 3 OBS ARE IN THE DATA SET (the
  54. division by zero occurs in ob number 4).
  55.  
  56. Under Rel. 6.07, the behavior is similar to 5.18.  The log contains
  57. the message "Note : Division by zero detected at line 4 column 6".
  58. The data set contains the full 10 obs and the quotent is set to
  59. missing for the 'bad' obs.
  60.  
  61. So, if you are using SAS 6.06 under VM/ESA, be very careful of division
  62. by zero.  It can truncate your data set without an obvious error message.
  63.  
  64. Caveat Emptor.
  65.  
  66. Barry Walton   BITNET : BWALTON @ MILLERSV
  67.  
  68. Millersville University of PA
  69.