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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 733 views
  • 0 likes
  • 4 in conversation