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