home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Subject: (no subject given)
- Path: sparky!uunet!paladin.american.edu!auvm!VCUMVS.BITNET!RIKARD
- Message-ID: <SAS-L%92072016093798@VTVM2.BITNET>
- Newsgroups: bit.listserv.sas-l
- Date: Mon, 20 Jul 1992 16:09:36 -0400
- Reply-To: RIKARD@VCUMVS.BITNET
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: RIKARD@VCUMVS.BITNET
- Lines: 62
-
- ******************************************************************
- Content: Response
- Summary: Proc Sort.
- Release and platform: 5.18 and 6.07 under MVS
- Name: Pete Rikard
- Mail addresses:BITNET Rikard@vcumvs Internet rikard@vcuucc.ucc.vcu.edu
- Real Addresses:Virginia Commonwealth University, Computer Center
- 110 S. 7th Street, 4th Floor, Richmond, VA 23219
- Phone (804) 786-4828 FAX: (804) 371-8464
- ******************************************************************
- I like it, I like it. I would call this a stupid user trick from
- Late Night with SAS-L, but that wouldn't be SAS PC.
- > Sometimes, just when you think you understand the SAS algorithms,
- > something pops up and make you existentially insecure. Consider
- > the following.
- > A student was trying to sort two datasets by, say, id and
- > school, in order to merge them together. She clearly wanted
- > the dataset to look like id's within school's. She tried
- > the following code:
- > proc sort data=one;
- > by school;
- > by id;
- > proc sort data=two;
- > by school;
- > by id;
- > data total;
- > merge one two;
- > by school;
- > by id;
- >
- > Needless to say, the merge did not work, as it did not find
- > the datasets "sorted" by school. I straightened her out by
- > .... Anyway, what gives? Can anyone suggest what SAS is doing here?
- *****************************************************************
- lots more good commentary followed.
- Actually I have learned more from what my users tried to do and
- the interesting results they got than from many well schooled
- users.
-
- I admit that I haven't seen anyone try this and it's wrong, wrong,
- wrong. But it is interesting.
-
- It's wrong, wrong, wrong cause what you get is apparently version
- dependent. A partial test for MVS was:
- proc sort; by a b ; by descending b a;
- 5.18 gives a b
- 6.07 gives descending b a;
- proc sort; by a ; by descending b a;
- 5.18 gives a descending b;
- 6.07 gives descending b a;
- proc sort; by a ; by descending b ;
- 5.18 gives a descending b;
- 6.07 gives descending b ;
- 5.18 appears to give the sort of the FIRST use of the variable
- in all BY statements and 6.07 seems to simply use the last BY
- statement given.
-
- In any case, users should only have one by statement.
- ******************************************************************
- This is duplicate message, my mailer has gone to sleep, so I send
- this a second time, another way.
- ******************************************************************
-