Date: Thu, 15 Jul 2010 15:56:52 +0000
Reply-To: "Keintz, H. Mark" <mkeintz@WHARTON.UPENN.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Keintz, H. Mark" <mkeintz@WHARTON.UPENN.EDU>
Subject: Re: How to compress multiple decimal points
In-Reply-To: <DA7A3BE3039393429D5F86ACA89E3699C2EAEA952B@UCMAILBE2.ad.uc.edu>
Content-Type: text/plain; charset="iso-8859-1"
David:
1. I added a dataline with the value
20,000.
to the program sample and could not reproduce the problem you described.
2. On followups to SAS-L threads, I'd recommend keeping SAS-L in the email list. SAS-L is never on vacation, but I occasionally am.
Regards,
Mark
From: Brewer, David (brewerdi) [mailto:BREWERDI@ucmail.uc.edu]
Sent: Thursday, July 15, 2010 9:53 AM
To: Keintz, H. Mark
Subject: How to compress multiple decimal points
Hi Mark,
You replied to my SAS-L post about how to compress multiple decimal points on Thursday, July 8.
data _null_;
input text $;
put "Before " text= @;
ix=index(text,'.');
if ix>0 then substr(text,ix+1)=compress(substr(text,ix+1),'.');
put @22 "After " text= ;
datalines;
100
100.2
100..3
100.4.
100..5.
100...6
100.7.0
100.8.0.
;
run;
I just came across some data that is causing an "Invalid second argument to function SUBSTR". If you have a value with a comma in it, you will get the NOTE in the log; ex) ">20,000." (no quotes). If you omit the comma, the problem goes away.
Do you know why this is happening and how to solve the problem? Compressing the comma does not solve it.
Thanks again for your help.
Dave
|