BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
PriyaB
Fluorite | Level 6

According to the question I have write the data set but it is not working for me.  I am not able to identify the problem so request you to please correct the error.

I am attaching 1. Question 2. written program 3. log section below.

 

1.

PriyaB_0-1709727763208.png

 

2.

PriyaB_1-1709727870309.png

 

3.

PriyaB_2-1709728006446.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
SASJedi
Ammonite | Level 13

The AND operator compares the results of two complete logical expressions:

IF logical expression 1  is true AND logical expression 2 is true THEN DO something;

In your code, expression 1 (sales>=100000) is OK, but expression 2 (>=200000) is incomplete, hence the error:  

if sales>=100000 AND <=200000

You need to specify what value should be checked to see if it is less than 200000. Try this:

if sales>=100000 AND sales <=200000

That should work better.

May the SAS be with you!
Mark

Check out my Jedi SAS Tricks for SAS Users

View solution in original post

3 REPLIES 3
SASJedi
Ammonite | Level 13

The AND operator compares the results of two complete logical expressions:

IF logical expression 1  is true AND logical expression 2 is true THEN DO something;

In your code, expression 1 (sales>=100000) is OK, but expression 2 (>=200000) is incomplete, hence the error:  

if sales>=100000 AND <=200000

You need to specify what value should be checked to see if it is less than 200000. Try this:

if sales>=100000 AND sales <=200000

That should work better.

May the SAS be with you!
Mark

Check out my Jedi SAS Tricks for SAS Users
PriyaB
Fluorite | Level 6

Thank you so much it worked.

 

Regards 

Priya

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
LIBNAME 101

Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 3218 views
  • 2 likes
  • 3 in conversation