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;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: