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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.