BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Nancy05
Quartz | Level 8

Hi ,

 

I am new to SAS Enterprise Guid. How do I write the data clause as I only want the data set where particalar observations is not null or empty.

 

For example:

 

data mydataset;

   set orion.employee;

  where <employeeName is not empty or blank>?

 

proc print data = mydataset;

run;

 

How do I write empoyeeName is not empty? what is the syntaxt for not empty for blank in SAS langauge?

 

Thanks!

Nancy

1 ACCEPTED SOLUTION

Accepted Solutions
6 REPLIES 6
Reeza
Super User

Where not missing(variable);

 

SAS treats null and blanks/missing the same in most cases. 

Nancy05
Quartz | Level 8

Hi Reeze,

 

Thanks for the reply.

 

Where not missing(variable); 

does seems work; However,

 

 

Where variable ne ' ';

works.

 

 

Thank you anyway!

Nancy

 

 

Reeza
Super User

Yes it will, for character variables. 

For numeric you use

 

where variable ne .;

 

Not Missing works for either character or numeric. 

Nancy05
Quartz | Level 8

How about Date type variable?

Reeza
Super User

SAS only has two data types, numeric and character.

 

Dates are numeric, with a date format applied.

A date is the number of days from Jan 1, 1960

A datetime is the number of seconds from Jan 1, 1960

 

Hope that helps.

 

There can be more data types if you're using DS2 but I'm assuming that you're not. And they only exist within the DS2 step.

Nancy05
Quartz | Level 8

Okay. Thank you for your reply!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 170585 views
  • 5 likes
  • 2 in conversation