hi, I am trying to check for missing values in the dataset.
Below is the code I used to check for missing values:
PROC PRINT data = WORK.IMPORT;
WHERE ID = ' ' OR name = .;
RUN;
Below is the error message after running the code:
ERROR: WHERE clause operator requires compatible variables.
@Ngo99 wrote:
hi, I am trying to check for missing values in the dataset.
Below is the code I used to check for missing values:
PROC PRINT data = WORK.IMPORT;
WHERE ID = ' ' OR name = .;
RUN;
Below is the error message after running the code:
ERROR: WHERE clause operator requires compatible variables.
I seriously doubt that a variable called "name" will be numeric. Check for the data types of the variables and use the proper missing values.
To define a where clause syntax that deals with both numerical and character variables you could use the missing() function as below:
WHERE missing(ID) or missing(name);
or alternatively the cmiss() function:
where cmiss(id,name)>0;
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 save with the early bird rate—just $795!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.