Help using Base SAS procedures

Null variable

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 145
Accepted Solution

Null variable

I have data-set with 10 variables, ID, R1,R2,R3,R4,R5,R6,R7,R8,R9....I have to write in such a way that output should contain records where R1-R9 is not null for atleast one of them......


Accepted Solutions
Solution
‎04-06-2015 03:28 PM
Frequent Contributor
Posts: 115

Re: Null variable

Posted in reply to rakeshvvv

Same as Ballard, with the N function:

data want;

     set have;

     if n(of r1-r9) >=1;

run;

View solution in original post


All Replies
Super User
Posts: 11,343

Re: Null variable

Posted in reply to rakeshvvv

data want;

     set have;

     if nmiss(of r1-r9) <9;

run;

would be one way.

Solution
‎04-06-2015 03:28 PM
Frequent Contributor
Posts: 115

Re: Null variable

Posted in reply to rakeshvvv

Same as Ballard, with the N function:

data want;

     set have;

     if n(of r1-r9) >=1;

run;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 168 views
  • 3 likes
  • 3 in conversation