LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 6 May 2005 16:42:47 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: changing subject-My Proc report Question
Comments: To: chang_y_chung@hotmail.com
In-Reply-To:  <200505061417.j46EHk12022228@listserv.cc.uga.edu>
Content-Type: text/plain; format=flowed

Chang,

I almost disagreed with you because normally in a format X - Y = 'Something' will include both X and Y, while X <- Y = 'Something' will exclude only the X and include the Y.

In the case of the formats you presented, SAS sees that 4 already has a slot that is included and excludes it from the domain of '4 - high'. Which is interesting because the normal mappings are as:

5 - 10 (5 to 10 inclusive) 5 <- 10 (exclude 5 , include 10) 5 -< 10 (include 5 , Exclude 10) 5 <-< 10 (5 to 10 Exclusive)

Which means that SAS should include '4' in the case of '4 - High' and excluded it in the case of '4 <- High'. But it doesn't, which leads me to wonder if it is a bug induced when SAS added the multilabel option or is it SAS being smart.

If one adds the multilable option:

proc format cntlout = test ; value testa (multilabel) 1 - high = '>1' 1 = '1' ;

select testa ;

run ;

proc print data = test ; run ;

You will find that yes both '1' and '1 - high' will include '1', and '1 - high' will include 'high'. For those really interested look at 'sexcl' and 'eexcl' variables in the output dataset you will 'N','N' respectively meaning that SAS will include both the starting and ending ranges in the domain.

In any event I guess its time to update the documentation and papers out there. Wonder if there is any little birdies that know why this is happening?

Toby Dunn

From: Chang Chung <chang_y_chung@HOTMAIL.COM> Reply-To: Chang Chung <chang_y_chung@HOTMAIL.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: Re: changing subject-My Proc report Question Date: Fri, 6 May 2005 10:17:46 -0400 On Fri, 6 May 2005 07:16:30 -0400, Dennis Diskin <ddiskin@GMAIL.COM> wrote:

>Moorthy, > >First you have to fix the format as it will give you an error as is: >change >4-high ='>4' >to >4<-high ='>4'

Hi,

Uh.... I totally agree with Dennis on that it is a much much better practice to make the ranges explicit. But in this case, proc format does implicitly exclude the value of 4 from the ">4" category by being overlapped with the next range. See my test result below.

Cheers, Chang

proc format cntlout=implicit; value implicit 4-high ='>4' 4='4' 3='3' 2='2' 1='1' 0='0' ; select implicit; run;

proc format cntlout=explicit; value explicit 4<-high ='>4' /* explicitly exclude 4 */ 4='4' 3='3' 2='2' 1='1' 0='0' ; select explicit; run;

proc compare base=implicit(drop=fmtname) compare=explicit(drop=fmtname); run; /* on lst -- yes. this line is on lst not on log :-) NOTE: No unequal values were found. All values compared are exactly equal. */


Back to: Top of message | Previous page | Main SAS-L page