home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / bit / listserv / sasl / 5033 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  3.4 KB

  1. Path: sparky!uunet!utcsri!torn!nott!dgbt!netfs!ub!zaphod.mps.ohio-state.edu!darwin.sura.net!paladin.american.edu!auvm!PHPDLS1.EM.CDC.GOV!RJF2
  2. From: rjf2@PHPDLS1.EM.CDC.GOV
  3. Newsgroups: bit.listserv.sas-l
  4. Subject: proc FORMAT: oops on numeric values
  5. Message-ID: <2B021F19@router.em.cdc.gov>
  6. Date: 12 Nov 92 18:07:00 GMT
  7. Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  8. Reply-To: rjf2@PHPDLS1.EM.CDC.GOV
  9. Lines: 71
  10. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  11. X-Delivery-Notice:  SMTP MAIL FROM does not correspond to sender.
  12. Return-Path: rjf2@PHPDLS1.EM.CDC.GOV
  13. Encoding: 75 TEXT
  14. X-Mailer: Microsoft Mail V3.0 (beta-2)
  15. Comments: To: SAS-L@UGA.BITNET, vpm1@OPSIRM1.EM.CDC.GOV
  16.  
  17. content      : Question
  18. summary      : proc FORMAT: improper formatting
  19. rlse/platform: V6.07 / MVS
  20.  
  21. Hello, crew: I need some help understanding what is happening with the FORMAT
  22. that I am using to show percents from proc FREQ.
  23.  
  24. **************************************************************************
  25. My Questions are:
  26. what options in proc FORMAT do I jiggle to get my reports correct?
  27. or
  28. what do I need to do to my FREQ SSD Percent value so that it will be
  29. formatted correctly?
  30. **************************************************************************
  31.  
  32. My usual usage is to store the output SSD from proc FREQ and print it later
  33. using a DATA _NULL_. Since I put only 3 digits in the report, I created a
  34. format for (99..100) = '>99'. 99% and 100% are supposed to be shown exactly
  35. and values between 99 and 100 and supposed to be shown as '>99' %.
  36.  
  37. I have been using this format for 4 years; it was written in V5.16 and worked
  38. successfully through 5.18 and 6.06. Today, I am not pleased with it.
  39.  
  40.  
  41. Here is test code which shows the difference between a numeric value created
  42. by SAS and another supposedly equal numeric value, which is formated
  43. correctly:
  44.  
  45. *RJF2.MPEPHTLV.P9205PGM(ZPERCENT)
  46. *RJF2:92Nov12 test of Percent format working incorrectly;
  47. options nocenter;
  48. proc FORMAT; value PCNT /*(fuzz=.0005)*/ 99 <-< 100  = '>99' ;
  49.  
  50. DATA SAS_N   ;
  51.   do SAS_N = 98.999 to  99.001 by 0.001,
  52.              99.999 to 100.001 by 0.001 ;
  53.     SAS_Frmt = SAS_N;
  54.     %LET W  =  7;
  55.     %LET D  = %eval(&W - 4);
  56. *   format          SAS_N   &W..&D ;
  57.     C       =   put(SAS_N  ,&W..&D);
  58.     N       = input(C      ,&W..&D);
  59.     N_Frmt  = N;
  60.     NeqSAS_N= (SAS_N  = N);
  61.     output;                                                        end;
  62.  
  63. proc PRINT;
  64.  format SAS_Frmt  N_frmt pcnt.  ;
  65.  
  66. Here is the OUTPUT:
  67.  
  68. OBS     SAS_N     SAS_FRMT       C          N       N_FRMT    NEQSAS_N
  69.  
  70.  1      98.999       99        98.999     98.999      99          1
  71.  2      99.000      >99        99.000     99.000      99          0
  72.  3      99.001      >99        99.001     99.001     >99          0
  73.  4      99.999      >99        99.999     99.999     >99          1
  74.  5     100.000      >99       100.000    100.000     100          0
  75.  6     100.001      100       100.001    100.001     100          0
  76.  
  77. ************************************************************************
  78. Values for N are formatted correctly under N_FRMT.
  79.  
  80. Note that obs 2 and 5 for SAS_N are formatted incorrectly under SAS_FRMT.
  81.  
  82. Any help, opinions, direction, guidance, etc, will be appreciated.
  83.  
  84. Ron Fehd     :                SMTP:BitNet:    <rjf2@phpdls1.em.cdc.gov>
  85.               Centers for Disease Control
  86.               1600 Clifton Rd  MS:G25         FAX  : 404/639-1778
  87.               Atlanta, GA 30333  USA          phone: 404/639-1707
  88.