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.
2.
3.
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
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
Thank you so much it worked.
Regards
Priya
The DATA step language provides a way to combine the comparisons, logically equivalent to BETWEEN in SQL:
if 100000 <= sales <= 200000
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →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.