Previous Topic: What You Can DoNext Topic: Selective Processing


Demonstration

Objective

The next report lists employees in alphabetical order by performing a sort on employee last name.

Parameters

01SORT LAST-NAME

01 is the report number.

The SORT parameter is coded in columns 4 to 8, immediately after the report number.

LAST-NAME is the sort field. This field is also defined to the report by appearing on the REC parameter.

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
013 EMPLOYEE SALARY LISTING
01SORT LAST-NAME
0151*010 EMPLOYEE SZ=20  HH 'EMPLOYEE'
0151*020 SALARY          HH 'SALARY'

Result

REPORT NO. 01                 EMPLOYEE SALARY LIST          mm/dd/yy PAGE     1                     EMPLOYEE                          SALARY               MICHAEL   ANGELO                          18,000.00               DONTE     BANK                            80,000.00               ALBERT    BREEZE                          38,000.00               BETH  M.  CLOUD                           52,750.00               ALAN      DONOVAN                         33,500.00               PERCY     EINSTEIN                        34,500.00               JANE      FERNDALE                        22,500.00               TOM       FITZHUGH                        13,000.00               ROBIN     GARDNER                         14,000.00               JENNIFER  GARFIELD                        65,000.00               VLADIMIR  HEAROWITZ                       33,000.00               EDWARD    HUTTON                          44,000.00               JOCK      JACKSON                         34,000.00               JAMES     JACOBI                          55,000.00               JULIE     JANSSEN                         37,000.00               RUPERT    JENSON                          82,000.00               MARYLOU   JOHNSON                             12.00               CYNTHIA   JOHNSON                         13,500.00               DOUGLAS   KAHALLY                         20,000.00