Go Back   Rhinocerus > Newsgroup > Newsgroup comp.soft-sys.sas

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 06-15-2006, 04:38 PM
nospam@HOWLES.COM (Howard Schreier
Guest
 
Posts: n/a
Default Re: functionality of the in(xxx:xxx) function

On Thu, 15 Jun 2006 08:35:46 -0700, Choate, Paul@DDS <pchoate@DDS.CA.GOV>
wrote:

>Jon-
>
>then mailid = 21 and lettertextid = 'LA2';
>
>should be two separate statements
>
>then do;
>mailid = 21;
>lettertextid = 'LA2';
>end;


And there was probably a clue in Jonathan's log:

NOTE: Variable lettertextid is uninitialized.

The code was syntactically OK. The statement

mailid = 20 and lettertextid = 'LA1';

or

mailid = ( 20 and lettertextid = 'LA1' );

will first compare the variable LETTERTEXTID to the literal "LA1",
yielding probably a 0 (false) though possibly a 1( true). In either case,
when this result is ANDed to 20, the result is 0 (false).

>
>
>hth
>
>Paul Choate
>DDS Data Extraction
>(916) 654-2160
>
>> -----Original Message-----
>> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
>> Jonathan Woodring
>> Sent: Thursday, June 15, 2006 8:26 AM
>> To: SAS-L@LISTSERV.UGA.EDU
>> Subject: functionality of the in(xxx:xxx) function
>>
>> If I am not mistaken (which I probably am), then in operator seems to

>be
>> malfunctioning. SAS 9.1.3. The following code:
>>
>>
>>
>> data cms.drop1criteriafinal;
>>
>> set cms.drop1criteriaexport;
>>
>> if _N_ in(1:5000) then mailid = 20 and lettertextid = 'LA1';
>>
>> else if _N_ in(5001:10000) then mailid = 21 and

>lettertextid
>> = 'LA2';
>>
>> else if _N_ in(10001:15000) then mailid = 23 and
>> lettertextid = 'LA3';
>>
>> else if _N_ in(15001:20000) then mailid = 24 and
>> lettertextid = 'LA4';
>>
>> else if _N_ in(20001:25000) then mailid = 25 and
>> lettertextid = 'LA5';
>>
>> else if _N_ in(25001:30000) then mailid = 26 and
>> lettertextid = 'LA6';
>>
>> run;
>>
>>
>>
>> results in a variable 'mailid' that has a value of 0 for all
>> observations, while the variable 'lettertextid' is missing for all
>> observations. I've stared at the syntax and played around, to no

>avail.
>> Am I missing something here? Thanks guys!
>>
>>
>>
>> Jonathan

Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
proc report need number to be date gscsrc@hotmail.com Newsgroup comp.soft-sys.sas 11 10-29-2007 03:46 PM
Re: functionality of the in(xxx:xxx) function data _null_; Newsgroup comp.soft-sys.sas 0 06-15-2006 04:02 PM
Re: functionality of the in(xxx:xxx) function toby dunn Newsgroup comp.soft-sys.sas 0 06-15-2006 03:53 PM
Re: functionality of the in(xxx:xxx) function Choate, Paul@DDS Newsgroup comp.soft-sys.sas 0 06-15-2006 03:35 PM
Re: Function reference with versions ? Choate, Paul@DDS Newsgroup comp.soft-sys.sas 0 03-20-2006 04:59 PM



All times are GMT. The time now is 09:37 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.