Hi Experts Good Morning
Here my dataset using Missing function both numeric and character flag variable like slno missing course_name missing
data miss_var;
input slno course_name$ 12.;
if missing(course_name) then do ;
put 'course_name is missing.' ;
end;
else if missing(id) then do;
put 'slno is missing.';
end;
datalines;
001 java
002 c++
003 javascript
node js
005
pandas
;
run;
Hi,
data miss_var;
input slno $ course_name $;
if missing(course_name) then do ;
check= 'course_name is missing.' ;
end;
else if missing(slno) then do;
check= 'slno is missing.';
end;
datalines;
001 java
002 c++
003 javascript
. node js
005 .
. pandas
;
run;
Please give solution
You are reading in your data incorrectly. If you run a PROC PRINT, you will see that. This INPUT statement would come closer to the mark:
input slno 1-3 coursename $ 5-16;
You might want to consider making SLNO number character, if you want to keep those leading zeros.
Hi,
data miss_var;
input slno $ course_name $;
if missing(course_name) then do ;
check= 'course_name is missing.' ;
end;
else if missing(slno) then do;
check= 'slno is missing.';
end;
datalines;
001 java
002 c++
003 javascript
. node js
005 .
. pandas
;
run;
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!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.