Date: Wed, 21 Apr 2004 15:15:45 -0700
Reply-To: "Terjeson, Mark" <TERJEM@DSHS.WA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark" <TERJEM@DSHS.WA.GOV>
Subject: Re: Else if Help
Content-Type: text/plain; charset=us-ascii
Hi David,
With proper punctuation in the assignment
statements and around the comments, this
seems to get TEST=1 for both. ????
data _null_;
Beg_Year_Mon = '200308';
bdue_stage = 4;
bnarex = 483;
Org_DOD = 9;
bcurr_bal = 683.66;
Org_Class = '4';
*This Works and sets Test =1.:;
If Beg_Year_Mon LE '200307' or (Beg_Year_Mon GE '200308' and bdue_stage =
4 and
(303 le bnarex le 483) and Org_DOD lt 36
and bcurr_bal ge 500 and Org_Class ne '8')or (
Beg_Year_Mon GE '200308' and bdue_stage = 4 and
(484 le bnarex le 626) and bcurr_bal ge 1189
and Org_Class ne '8') then Test = 1;
Else Test = 0;
put 'AAA' Test=;
*This set the value of TEST to 0 for the record described above.;
If Beg_Year_Mon LE '200307' then Test = 1;
else If Beg_Year_Mon GE '200308' and bdue_stage = 4 and
(303 le bnarex le 483) and Org_DOD lt 36
and bcurr_bal ge 500 and Org_Class ne '8' then Test = 1;
Else if Beg_Year_Mon GE '200308' and bdue_stage = 4 and
(484 le bnarex le 626) and bcurr_bal ge 1189
and Org_Class ne '8' then Test = 1;
Else Test = 0;
put 'BBB' Test=;
run;
/*
log excerpt is
AAATest=1
BBBTest=1
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
*/
Hope this is helpful,
Mark Terjeson
Reporting, Analysis, and Procurement Section
Information Services Division
Department of Social and Health Services
State of Washington
mailto:terjem@dshs.wa.gov
-----Original Message-----
From: Pleasant, David (GE Consumer Finance) [mailto:David.Pleasant@GE.COM]
Sent: Wednesday, April 21, 2004 2:29 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Else if Help
This one has been driving me crazy. I have two if Then Statement that
should both work, how ever only one does not. I have two records that are
having the TEST value set to 0 when it should be set to 1. Why is this
happening.
I have a record that has the following variables:
Beg_Year_Mon = '200308'
bdue_stage = 4
bnarex l= 483
Org_DOD = 9
bcurr_bal = 683.66
Org_Class ne '4'
This Works and sets Test =1.:
If Beg_Year_Mon LE '200307' or (Beg_Year_Mon GE '200308' and bdue_stage =
4 and
(303 le bnarex le 483) and Org_DOD lt 36
and bcurr_bal ge 500 and Org_Class ne '8')or (
Beg_Year_Mon GE '200308' and bdue_stage = 4 and
(484 le bnarex le 626) and bcurr_bal ge 1189
and Org_Class ne '8') then Test = 1;
Else Test = 0;
This set the value of TEST to 0 for the record described above.
If Beg_Year_Mon LE '200307' then Test = 1;
else If Beg_Year_Mon GE '200308' and bdue_stage = 4 and
(303 le bnarex le 483) and Org_DOD lt 36
and bcurr_bal ge 500 and Org_Class ne '8' then Test = 1;
Else if Beg_Year_Mon GE '200308' and bdue_stage = 4 and
(484 le bnarex le 626) and bcurr_bal ge 1189
and Org_Class ne '8' then Test = 1;
Else Test = 0;
g GE Consumer Finance
____________________________________________________________________________
___________________________________________
David Pleasant
Programmer Analyst
> GE Consumer Finance - North America
4500 Munson Street N.W.
Canton, OH 44718
Phone: (330) 433-5816 Dial Comm 360-5816
Fax: (330) 433-5604 Dial Comm 360-5604
Pager (877) 680-8854
E-Mail: David.Pleasant@ge.com
"This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message."