Date: Wed, 12 May 2010 18:13:50 -0400
Reply-To: Chang Chung <chang_y_chung@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Chang Chung <chang_y_chung@HOTMAIL.COM>
Subject: Re: Alternative for "goto" in do loop
On Wed, 12 May 2010 16:56:26 -0500, Joe Matise <snoopy369@GMAIL.COM> wrote:
>Can't you use the ERROR statement and associated commands/auto variables to
>handle this rather than jumping about?
>
>-Joe
Hi, Joe,
Nope, you can't. We still need jumping. Below data step gets you 19 obs
instead of 2.
Cheers,
Chang
data three;
set sashelp.class;
if age < 14 then error "age error";
if height < 63 then error "height error";
if sex ^= "F" then error "sex error";
if not ("A"<=substr(name,1,1)<="S") then error "last name error";
put name=;
run;
|