S A M P L E   F O C E X E C S

Screens


Screens are used to limit the data fields selected to those which have acceptable values. Any number of screening conditions may be used.
                        EXAMPLE

   is            if  cdos is av or aq
   eq            if  monfte eq 1.0000
   is-not        if  cretsys is-not B or U or F
   ne            if  monfte ne 1.0000
   from to       if  ctitle from 4000 to 9999 *
   ge            if  ctitle ge 4000 (greater than or equal to)
   Le            if  ctitle le 3999 (less than or equal to)
   is-more-than  if  ctitle is more-than 5000
   gt            if  ctitle gt 5000 (greater than)
   is-less-than  if  age is-less-than 50
   Lt            if  age lt 50
   Not-from to   if  ctitle not-from 3999 to 9999
   Contains      if  empname contains brown

* In a define use ge and le or gt and lt



A.   >
     tfs
     count empno if ctitle from 4000 to 9999
     end

     NUMBER OF RECORDS IN TABLE=    113  LINES=  1

     EMPNO
     COUNT
     -----
       113


B.  >
    tfs
    count empno if age le 50
    end

    NUMBER OF RECORDS IN TABLE=    694  LINES=    1

    PAGE     1

    EMPNO
    COUNT
    -----
      694


C.   >
     tfs
     count empno
     if ctitle gt 0800
     if ctitle lt 3999
     end

     NUMBER OF RECORDS IN TABLE=     236  LINES=

     EMPNO
     COUNT
     -----
       236
Screens on Accumulated Values

Screens may also be used to limit the data fields to those with acceptable total values. Example A screens individual gross pay records and accepts only those with values greater than "x". Example B sums the gross pay records and accepts their total, only if the total is greater than "x". Example C is like Example B, except it sums the gross pay records by employee, then test the total gross by employee and accepts only those with gross pay greater than "x".

A.   >
     sum monqrs if mongrs qe 14000.00
     end

     NUMBER OF  RECORDS  IN  TABLE=    20 LINES=      1

     PAGE      1

                   MONGRS
                   ------
               102,036.10



B.   >
     sum mongrs if total monars ge 4000
     end

     NUMBER OF  RECORDS  IN  TABLE=   1200  LINES=      1
     (BEFORE TOTAL TESTS)

     PAGE      1

                   MONGRS
                   ------
             1,122,729.12



C.   >
     tfs
     sum mongrs by empno
     if total mongrs ge 2000
     end

     NUMBER OF RECORDS IN TABLE=      1206 LINES=   807
     (BEFORE TOTAL TESTS)

      PAGE      1

      EMPNO         MONGRS
      -----         ------
      000022120   2,758.34
      000025125   5,583.33
      000092124   2,042.00
      000102129   2,521.00
      000124121   2,140.00
      000127129   2,800.00

Back to Sample Focexecs