home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- 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
- Message-ID: <SAS-L%92110911202183@OHSTVMA.ACS.OHIO-STATE.EDU>
- Newsgroups: bit.listserv.sas-l
- Date: Mon, 9 Nov 1992 11:20:36 ET
- Reply-To: BWALTON@MILLERSV.BITNET
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: BWALTON@MILLERSV.BITNET
- Subject: Division by zero
- Lines: 57
-
- CONTENT : Response
- SUMMARY : Results of division by zero under different versions of SAS
- REL/PLTF : SAS 5.18, 6.06, 6.07 under VM/ESA
- E-ADDR : BWALTON@MILLERSV (BITNET)
- NAME : Barry Walton
- ADDRESS : P.O. Box 1002 Millersville PA 17551-0302
- PHONE : (717) 872-3667
-
- Recently, SUMA @ CLEMSON asked about what happens when SAS encounters
- a division by zero. This problem cropped up here about a year or so
- ago, and I think I mentioned it to the list at that time. I set up
- a small program to create a 10 item data set, with a division by
- zero about halfway through:
- * CHECK FOR DIVIDE BY ZERO ;
- DATA CC;
- INPUT X Y;
- Z = X/Y;
- CARDS;
- 1 1
- 2 1
- 1 2
- 1 0 <--- Division by zero
- 3 3
- 4 2
- 2 4
- 3 4
- 3 1
- 1 3
- ;
- PROC PRINT DATA = CC;
- ENDSAS;
-
- What happens (under VM/ESA) depends upon which version of SAS one
- is using.
-
- Under Rel. 5.18 one gets a message in the SAS log that says "Note :
- division by zero at line 4 column 6". The data set (as displayed
- with PROC PRINT) contains all 10 obs, with the quotent (Z) set to
- missing for the 'bad' obs (the one with the division by zero).
-
- Under Rel. 6.06 the log contains the message "Note : the data step has
- been abnormally terminated", AND ONLY 3 OBS ARE IN THE DATA SET (the
- division by zero occurs in ob number 4).
-
- Under Rel. 6.07, the behavior is similar to 5.18. The log contains
- the message "Note : Division by zero detected at line 4 column 6".
- The data set contains the full 10 obs and the quotent is set to
- missing for the 'bad' obs.
-
- So, if you are using SAS 6.06 under VM/ESA, be very careful of division
- by zero. It can truncate your data set without an obvious error message.
-
- Caveat Emptor.
-
- Barry Walton BITNET : BWALTON @ MILLERSV
-
- Millersville University of PA
-