Example 10
COPY FROM(IN) USING(OUTF)
DISPLAY FROM(TEMP) LIST(EMPCT) BLANK -
TITLE('Employees by Function') -
DATE -
HEADER('Function') HEADER('Employees') -
ON(1,25,CH) ON(30,4,ZD)
This example shows how the OUTFIL table lookup feature can be used
to substitute meaningful phrases for cryptic values in ICETOOL reports.
Assume that:
- The OUTFCNTL data set contains:
OUTFIL FNAMES=TEMP, OUTREC=(1:9,2,CHANGE=(25, C'MN',C'Manufacturing', C'RD',C'Research and Development', C'FN',C'Finance', C'MR',C'Marketing', C'IS',C'Information Systems'), 30:4,4)
The COPY operator uses the OUTFIL statement in OUTFCNTL to reformat
the IN data set records to the TEMP (temporary) data set. Two fields
are extracted for use by the DISPLAY operator:
- The 2-character department code in positions 9-10 is changed to a 25-character name in positions 1-25 using the table lookup feature.
- The zoned decimal value in positions 4-7 is moved to positions 30-33.
The DISPLAY operator uses the reformatted fields in the TEMP data
set to print, in the EMPCT data set:
- A title line containing the specified title and the date
- A heading line containing the specified underlined headings
- Data lines in the BLANK format containing:
- The names from positions 1-25 that were substituted for the department codes
- The zoned decimal values from positions 30-33.
The EMPCT output starts on a new page and looks as follows:
Employees by Function 02/14/05
Function Employees
------------------------- ---------
Manufacturing 486
Marketing 21
Research and Development 55
Information Systems 123
Finance 33