Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- What is the difference between if a and if a and n...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-30-2015 06:52 PM

Hi,

Please can someone explain with a simple dataset merge and proc sql example the difference between following scenarios:

1. if a

2. if b

3. if a and not b

4. if not a and b

Thanks

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to dkanand86

06-30-2015 08:17 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to dkanand86

06-30-2015 09:13 PM

These are simple logical conditions, whether it's a DATA step, SQL, or a treatise by Aristotle.

Assuming that "a" and "b" can be either true or false:

if a ==> true whenever "a" is true, regardless of the value of "b"

if b ==> true whenever "b" is true, regardless of the value of "a"

if a and not b ==> true whenever "a" is true and "b" is false

if not a and b ==> true whenever "a" is false and "b" is true

In SAS programming, if "a" and "b" represent numeric amounts rather than comparisons, SAS considers 0 and missing to be false and any other value to be true.

Good luck.