BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BrahmanandaRao
Lapis Lazuli | Level 10

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;
1 ACCEPTED SOLUTION

Accepted Solutions
anushreebiotech
Obsidian | Level 7

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;

View solution in original post

4 REPLIES 4
BrahmanandaRao
Lapis Lazuli | Level 10

Please give solution

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

@BrahmanandaRao are you sure that this line of code works"

 

input slno course_name$ 12.;

 

 

Astounding
PROC Star

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.

anushreebiotech
Obsidian | Level 7

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;