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;

SAS Innovate 2025: Register Now

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!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 4 replies
  • 979 views
  • 0 likes
  • 4 in conversation