Previous Topic: What You Can DoNext Topic: Demonstration (2): Selecting Records with Multiple Criteria


Demonstration (1): Selecting Records with Single Criteria

Objective

We are going to modify our report by listing only employees earning $50,000.00 and over.

The following code selects the appropriate records:

Parameters

SEL SALARY GE 50000.00

SEL SALARY GE 50000.00 specifies selection of salaries equal to or greater than 50,000.00.

or

BYP SALARY LT 50000.00

BYP SALARY LT 50000.00 specifies omission of salaries less than 50,000.00.

Complete Code

col. 2
▼
IN 200 F 400 PS(TAPE)
REC EMPLOYEE        5   25
REC LAST-NAME      15   15
REC SALARY        160    5  3  DP=2
SEL SALARY GE 50000.00
013 EMPLOYEE SALARY LISTING
01SORT LAST-NAME
0151*010 EMPLOYEE      HH 'EMPLOYEE'
0151*020 SALARY SZ=10  HH 'SALARY'

Result

REPORT NO. 01                 EMPLOYEE SALARY LISTING       mm/dd/yy PAGE     1                                         EMPLOYEE                                           SALARY                                MONTE     BANK                                              80,000.00                                BETH      CLOUD                                             52,750.00                                HERBERT   CRANE                                             75,000.00                                JENNIFER  GARFIELD                                          65,000.00                                HENRIETTA HENDON                                           240,000.00                                JAMES     JACOBI                                            55,000.00                                RUPERT    JENSON                                            82,000.00                                BURT      LANCHESTER                                        54,500.00                                RENE      MAKER                                             85,000.00                                DANIEL    MOON                                              72,000.00                                THEMIS    PAPAZEUS                                         100,000.00                                ELEANOR   PEOPLES                                           80,000.00                                JOHN      RUPEE                                             80,000.00                                ROGER     WILCO                                             80,000.00                                ROBBY     WILDER                                            90,000.00                                                                                         1,291,250.00