Library /sys$common/syshlp/HELPLIB.HLB  —  RDML72  Statements  Rel Operators
    Compare value expressions. Relational operators are used in
    conditional expressions. See the table in the list of subtopics
    for a summary of the RDML relational operators.

1  –  Table

          Relational       Value
          Operator
    -------------------------------------------------------------
          EQ        =      True if the two value expressions are
                           equal.

          NE        <>     True if the two value expressions are
                           not equal.

          GT        >      True if the first value expression is
                           greater than the second.

          GE        >=     True if the first value expression is
                           greater than or equal to the second.

          LT        <      True if the first value expression is
                           less than the second.

          LE        <=     True if the first value expression is
                           less than or equal to the second.
    -------------------------------------------------------------

         Note:   In all cases, if either value expression is
                 missing, the value of the condition is missing.

2  –  Examples

    The following programs demonstrate the use of the LE (less than
    or equal to) operator in a FOR statement. The programs create a
    record stream of all those employees who have an employee ID less
    than or equal to 00400. The programs then print the employee IDs
    from the records in the record stream.

2.1  –  C Example

    #include <stdio.h>
    DATABASE PERS = FILENAME "PERSONNEL";

    main()
    {
    READY PERS;
    START_TRANSACTION READ_WRITE;

    FOR E IN EMPLOYEES WITH E.EMPLOYEE_ID LE "00400"
       printf ("%s\n", E.EMPLOYEE_ID);
    END_FOR;

    COMMIT;
    FINISH;
    }

2.2  –  Pascal Example

    program relation (input,output);
    DATABASE PERS = FILENAME 'PERSONNEL';

    begin
    READY PERS;
    START_TRANSACTION READ_ONLY;

    FOR E IN EMPLOYEES WITH E.EMPLOYEE_ID LE '00400'
       writeln (E.EMPLOYEE_ID);
    END_FOR;

    COMMIT;
    FINISH;
    end.
Close Help