DATA Step, Macro, Functions and more

SAS Components Different types

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

SAS Components Different types

where Funded_DT <> "01JAN1900";

ERROR: Expression using not equals (^=) has components that are of different data types.

 

Im not sure what I need to do to get this to run without erroring. Thanks

 

 

 


Accepted Solutions
Solution
‎12-22-2015 04:05 PM
Super User
Posts: 19,769

Re: SAS Components Different types

Posted in reply to ryanhawkeyejedi
You specify a date literal with an d at the end of the variable, otherwise SAS assumes that its just a character variable, and how would it know otherwise Smiley Wink

I personally prefer the NE rather than <> for not equals, but its a preference. I think at one time SAS didn't interpret it as not equals, so you may want to verify that it does in your version.

where Funded_DT ne "01JAN1900"d;

View solution in original post


All Replies
Solution
‎12-22-2015 04:05 PM
Super User
Posts: 19,769

Re: SAS Components Different types

Posted in reply to ryanhawkeyejedi
You specify a date literal with an d at the end of the variable, otherwise SAS assumes that its just a character variable, and how would it know otherwise Smiley Wink

I personally prefer the NE rather than <> for not equals, but its a preference. I think at one time SAS didn't interpret it as not equals, so you may want to verify that it does in your version.

where Funded_DT ne "01JAN1900"d;
Super User
Posts: 3,250

Re: SAS Components Different types

Posted in reply to ryanhawkeyejedi

where Funded_DT <> "01JAN1900"d;

New Contributor
Posts: 3

Re: SAS Components Different types

Thank you both for your help...Im still a newbie. Smiley Happy I appreciate both quick responses! Happy Holidays!!!
Contributor ndp
Contributor
Posts: 61

Re: SAS Components Different types

Posted in reply to ryanhawkeyejedi

Use where Funded_DT <> "01JAN1900"D; Hopefully you are using apprpriate option YEARCUTOFF

 

New Contributor
Posts: 3

Re: SAS Components Different types

What is YEARCUTOFF?
Super User
Posts: 3,250

Re: SAS Components Different types

Posted in reply to ryanhawkeyejedi

The YEARCUTOFF option sets the century for SAS dates if one is not specified. For example if you had used 01JAN00 instead of 01JAN1900 - does that mean 1900 or 2000?

 

In your case you are specifying the century so I don't think YEARCUTOFF applies. 

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 346 views
  • 0 likes
  • 4 in conversation