Previous Topic: What You Can DoNext Topic: Formatting Numeric Data


Demonstration

Objective

We are going to modify our report by:

Parameters

REC FIRST-NAME 5 10

FIRST-NAME 5 10 defines the first-name field separately from the last-name field to allow separate processing.

REC LAST-NAME 15 15

LAST-NAME 15 15 defines the last-name field separately from the first-name field to allow separate processing.

0251*010 LAST-NAME SZ=10 HH ' EMPLOYEE'

SZ=10 sets the column width to ten characters.

0251*020 FIRST-NAME SZ=1

SZ=1 sets the columnwidth to accommodate one character, which will truncate all but the first letter of the employee's first name.

0251*030 SALARY SZ=9 HH 'SALARY'

SZ=9 sets the column width for 9 numbers; without sizing, the column saves space for 13 digits plus commas and decimal points. When reducing the size, be sure to allow enough room for totals to print without truncation.

Complete Code

col. 2
▼
IN  200 F 400 PS(TAPE)
REC FIRST-NAME    5   10
REC LAST-NAME    15   15
REC SALARY         160    5  3  DP=2
023 EMPLOYEE SALARY LISTING
0251*010 LAST-NAME  SZ=10  HH '   EMPLOYEE'
0251*020 FIRST-NAME  SZ=1
0251*030 SALARY  SZ=9      HH 'SALARY'

Result

REPORT NO. 02        EMPLOYEE SALARY LISTING       mm/dd/yy PAGE     1                               EMPLOYEE                                                          SALARY                             BLOOMER                              J                              15,000.00                             HUTTON                               E                              44,000.00                             JENSON                               R                              82,000.00                             KIMBALL                              M                              45,000.00                             KING                                 D                              14,500.00                             NICEMAN                              B                              14,000.00                             CRANE                                H                              75,000.00                             FERNDALE                             J                              22,500.00                             FONRAD                               G                              14,750.00                             GARDNER                              R                              14,000.00                             KAHALLY                              D                              20,000.00                             KLWELLEN                             T                              43,000.00                             KRAAMER                              S                              14,000.00                             WILDER                               R                              90,000.00                                                                                              2,522,500.00