SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 2 Vol 1

LE

Name:
    LE (LET)
Type:
    Library Function
Purpose:
    Return a 1 if the first number is less than or equal to the second and return a 0 otherwise.
Description:
    SUBSET clauses do not support syntax like the following:

      LET Y = Y1 SUBSET Y1 > Y2
      LET Y = Y1 SUBSET Y1 >= Y2
      LET Y = Y1 SUBSET Y1 < Y2
      LET Y = Y1 SUBSET Y1 <= Y2
      LET Y = Y1 SUBSET Y1 = Y2
      LET Y = Y1 SUBSET Y1 <> Y2

    where Y1 and Y2 are both variables.

    This command is most typically used to create a tag variable that can be used on subsequent SUBSET clauses. For example, suppose that Y1 and Y2 are two previously created variables and we want to sum the values of Y1 that are less than or equal to the corresponding rows of Y2.

      LET TAG = LE(Y1,Y2)
      LET Y1SUM = SUM Y1 SUBSET TAG = 1
Syntax:
    LET <tag> = LE(<y1>,<y2>)             <SUBSET/EXCEPT/FOR qualification>
    where <y1> is a variable or a parameter;
                <y2> is a variable or a parameter;
                <tag> is a variable or a parameter (depending on what <y1> and <y2> are) where the computed values are stored;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
    LET TAG = LE(Y1,Y2)
    LET A = LE(3,2)
Default:
    None
Synonyms:
    None
Related Commands:
    LT = Return 1 where the first number is less than the second number and 0 otherwise.
    GE = Return 1 where the first number is greater than or equal to the second number and 0 otherwise.
    GT = Return 1 where the first number is greater than the second number and zero otherwise.
    EQ = Return 1 where the first number is equal to the second number and zero otherwise.
    NE = Return 1 where the first number is not equal to the second number and zero otherwise.
Applications:
    Data Management
Implementation Date:
    2021/06
Program:
    SKIP 25
    READ NATR332.DAT Y1 Y2
    LET TAG = LE(Y1,Y2)
    LET NLE = SUM TAG SUBSET TAG = 1
    LET N = SIZE Y1
    LET NGT = N - NLE
    PRINT "Number of rows where Y1 <= Y2:   ^NLE"
    PRINT "Number of rows where Y1 >  Y2:   ^NGT"
        
    The following output is generated.
    Number of rows where Y1 <= Y2:   7
    Number of rows where Y1 >  Y2:   3
        

Privacy Policy/Security Notice
Disclaimer | FOIA

NIST is an agency of the U.S. Commerce Department.

Date created: 06/28/2021
Last updated: 06/28/2021

Please email comments on this WWW page to alan.heckert@nist.gov.