correction;
you missed a blank in NE. that is between NE and .
IF score1 NE . AND score2 NE . AND score3 NE . THEN take='complete';
Your original code below
IF score1 NE. AND score2 NE. AND score3 NE. THEN take='complete';
is causing tokenizaion problem at compile time
correction;
you missed a blank in NE. that is between NE and .
IF score1 NE . AND score2 NE . AND score3 NE . THEN take='complete';
Your original code below
IF score1 NE. AND score2 NE. AND score3 NE. THEN take='complete';
is causing tokenizaion problem at compile time
@novinosrin has identified the issue and corrective action.
As an alternative, one can also make use of the missing function, e.g.:
if not missing(score1) and not missing(score2) and not missing(score3) then take='complete';
or, in your specific case, the nmiss function could also be of help, as it counts the number of missing numeric values, e.g.:
if nmiss(score1,score2,score3) eq 0 then take='complete';
Regards,
Amir.
Thank you!
If you want to do something when all values of numeric values are present you might want to consider the NMISS function instead of a bunch of If this and that and somethinelse comparisons:
If Nmiss(Score1, score2, score3) = 0 then take='complete';
if you have a lot of value you can even use list notation to reduce coding such as:
if nmiss( of score1-score25) =0 then take='complete';
which would certainly be a whole lot easier than 25 AND comparisons.
Thank you, this will be useful once I use larger data sets.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.