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;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.