As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Difference between revisions of "Tips:Use the BETWEEN-AND Operator to Search an Inclusive Range of Values"

From sasCommunity
Jump to: navigation, search
(gardening)
(migrated)
 
Line 1: Line 1:
 +
{{Template:Article_Migrated|https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Use-the-BETWEEN-AND-Operator-to-Search-an-Inclusive/m-p/475229#M172}}
 
The BETWEEN-AND operator can be used inside of a where [[statement]] to determine if the value of a variable is contained within an inclusive range:
 
The BETWEEN-AND operator can be used inside of a where [[statement]] to determine if the value of a variable is contained within an inclusive range:
 
<source lang='sas'>
 
<source lang='sas'>

Latest revision as of 14:33, 27 July 2018


As part of the decommissioning effort for sasCommunity.org this article/tip has been migrated to communities.sas.com.

The new home for this article/tip is Use the BETWEEN-AND Operator to Search an Inclusive Range of Values (https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Use-the-BETWEEN-AND-Operator-to-Search-an-Inclusive/m-p/475229#M172)



The BETWEEN-AND operator can be used inside of a where statement to determine if the value of a variable is contained within an inclusive range:

proc print data=sashelp.retail;
    where year between 1980 and 1984;
run;

Notice that the boundaries that you give are always included in the range, so in this case the data from 1980 and 1984 is printed, along with data from 1981-1983.


....see also

....read more

....read more

Submitted By Otterm1