Date: Fri, 16 May 2003 11:46:04 -0400
Reply-To: Ed Heaton <EdHeaton@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ed Heaton <EdHeaton@WESTAT.COM>
Subject: Re: problem with the proc format
Content-Type: text/plain; charset="iso-8859-1"
Rose,
You are using character representations for numbers. Character data sorts
differently than numeric data.
For character data, the values are sorted based on the value of the first
character. If there is a tie, the values are further sorted on the second
character, if there is still a tie ...
In your case, you have values "1" through "9" to represent Infectious
Diseases. Then you say that "11" through "45" represents Cancer. However,
"45" is between "1" and "9" because "4" is between "1" and "9". SAS will
not look past the first character because there is no tie.
Does this help? Am I clear?
Ed
Edward Heaton, Senior Systems Analyst,
Westat (An Employee-Owned Research Corporation),
1600 Research Boulevard, Room RW-3541, Rockville, MD 20850-3195
Voice: (301) 610-4818 Fax: (301) 610-5128
mailto:EdHeaton@westat.com http://www.westat.com
-----Original Message-----
From: Rose [mailto:myr_rose@YAHOO.COM]
Sent: Friday, May 16, 2003 11:19 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: problem with the proc format
Hi All,
does any one know what's wrong with this procedure?
proc format;
value $id
'1'-'9'= 'Infectious diseases '
'11'-'45'= 'Cancer '
'46', '47'= "Non-malignant neoplasm "
'48'= 'Thyroid disease '
'96', '97', '100'-'108'= ' Heart conditions'
'109'-'113'= 'Cerebrovascular disease'
'114'-'121'= " Other circulatory conditions arteries, veins, and
lymphatics "
'122'= ' Pneumonia '
'254'-'258','10'= 'Other care and screening'
;
ERROR: These two ranges overlap: 1-9 and 10-10 (fuzz=0).
ERROR: These two ranges overlap: 109-113 and 11-45 (fuzz=0).
ERROR: These two ranges overlap: 11-45 and 114-121 (fuzz=0).
NOTE: The previous statement has been deleted.
run;
thanks in advance.
Rose