BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
cdubs
Quartz | Level 8
data lab_valid (where=(troponin=1 & result_conv ne .& year>=2011));
set clean.lab_troponin

Specifically, I'm not sure what the "ne .&" means? 

 

Thank you! 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  That WHERE option is a test for 3 things to be true in order for the observation to be selected. So separate out the & first, and replace it with the logical AND, then the option becomes:

where=( troponin=1 AND result_conv ne . AND year >= 2011)

 

  So, an observation will only be selected if these 3 conditions are all true:

the variable TROPONIN must have a value equal to 1

the variable RESULT_CONV must have a value NOT equal to .   (. means a MISSING value for a numeric variable)

the variable YEAR must have a value that is greated than or equal to 2011

 

  With a SAS numeric variable a . is used to represent a missing value. For a character variable a space or blank is used to represent a missing value.

 

Hope this helps,

Cynthia

View solution in original post

4 REPLIES 4
WarrenKuhfeld
Rhodochrosite | Level 12

The period is the most common type of missing value.  Quite independently, ampersand means AND.  The code would be clearer if there were a space between the two.

cdubs
Quartz | Level 8
This works as a solution too! THANK YOU!!!!
Cynthia_sas
SAS Super FREQ

Hi:

  That WHERE option is a test for 3 things to be true in order for the observation to be selected. So separate out the & first, and replace it with the logical AND, then the option becomes:

where=( troponin=1 AND result_conv ne . AND year >= 2011)

 

  So, an observation will only be selected if these 3 conditions are all true:

the variable TROPONIN must have a value equal to 1

the variable RESULT_CONV must have a value NOT equal to .   (. means a MISSING value for a numeric variable)

the variable YEAR must have a value that is greated than or equal to 2011

 

  With a SAS numeric variable a . is used to represent a missing value. For a character variable a space or blank is used to represent a missing value.

 

Hope this helps,

Cynthia

cdubs
Quartz | Level 8

Thank you so much!

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
  • 4 replies
  • 1021 views
  • 2 likes
  • 3 in conversation