home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / bit / listserv / sasl / 5114 < prev    next >
Encoding:
Text File  |  1992-11-19  |  3.1 KB  |  63 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!gatech!nntp.msstate.edu!paladin.american.edu!auvm!CPMAIL-NZ.CIS.COLUMBIA.EDU!PASSRAY
  3. X-Mailer:     Pegasus Mail v2.3 (R3).
  4. Message-ID: <MAILQUEUE-101.921119123110.448@cpmail-nz.cis.columbia.edu>
  5. Newsgroups: bit.listserv.sas-l
  6. Date:         Thu, 19 Nov 1992 12:31:10 EDT
  7. Reply-To:     Ray Pass <PASSRAY@CPMAIL-NZ.CIS.COLUMBIA.EDU>
  8. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  9. From:         Ray Pass <PASSRAY@CPMAIL-NZ.CIS.COLUMBIA.EDU>
  10. Subject:      ORDER=ORDER in PROC REPORT
  11. Comments: To: SAS-L@uga.cc.uga.edu
  12. Lines: 49
  13.  
  14. ON  Wed, 18 Nov 1992 20:33:41 EST
  15.     Harry Sharp <sharp@SNUFF.CSD.SCAROLINA.EDU> wrote (in part)
  16.  
  17. ...
  18. > I am trying to use PROC REPORT in SAS 6.07 under MVS/XA and things are
  19. > working just fine except for one minor problem.  It seems that REPORT
  20. > alphabetizes the formatted values of an ACROSS variable.  I guess in most
  21. > cases this isn't a problem, but in my case it is.  My formats are
  22. > student classes (e.g. Freshman, Sophomore, Junior, Senior, etc.), and
  23. > these just don't look right alphabetized (e.g. F J Se So).
  24. ...
  25.  
  26. Andy Norton provided exactly the correct solution, the use of the 6.07 PROC
  27. REPORT option ORDER= (this was in 6.06 but not documented) with one important
  28. assumption, namely that the data was internally stored as 1,2,3,4, and then
  29. formatted to Freshman, Sophomore, Junior, Senior.  If this is how the data is
  30. stored and formatted then the problem is over and done with.  Next case.  As
  31. a matter of fact, this is exactly the data design I dealt with in my PROC
  32. REPORT paper in the SUGI '92, NESUG '92, MWSUG '91 and MWSUG '92 proceedings.
  33.  
  34. If however the data is stored as Freshman, Sophomore, Junior, Senior, then
  35. all is still not lost.  It just means a little recoding.  One way would be to
  36. use a seies of IF-THEN-ELSE statements to create a new variable (CLASS2) from
  37. the original variable (CLASS), with the 1,2,3,4 values, and then create a
  38. FORMAT which translated 1,2,3,4 back to F,So,J,Se, e.g. YEARFMT.  You would
  39. then use ORDER=INTERNAL and FORMAT=YEARFMT. on the DEFINE statement for the
  40. CLASS2 variable.
  41.  
  42. Instead of the IF-THEN-ELSE statements, you could also create two FORMATS,
  43. one to go from F,So,J,Se to 1,2,3,4 (LETNUM.) and one to go the other way
  44. (NUMLET.).  You would then create CLASS2 with an INPUT function as in
  45. CLASS2=INPUT(CLASS,LETNUM.) and use the other FORMAT in the DEFINE statement,
  46. DEFINE CLASS2 / ACROSS ORDER=INTERNAL FORMAT=NUMLET;
  47.  
  48. The problem is not with REPORT, but rather with the documentation.  But even
  49. that is not totally correct because as Andy notes, the ORDER= option is
  50. described in the all-important Tech Report P-222, (Release 6.07 enhancements).
  51.  
  52. Good luck.
  53.  
  54. Ray
  55.  
  56.  
  57.  *--------------------------------------------------------------------------*
  58.  | Ray Pass, Ph.D.                                    Voice: (212) 305-7748 |
  59.  | Columbia-Presbyterian Medical Center                 Fax: (212) 305-3302 |
  60.  | 161 Ft. Washington Ave.       AP1310                                     |
  61.  | New York, NY 10032-3784               passray@cpmail-nz.cis.columbia.edu |
  62.  *--------------------------------------------------------------------------*
  63.