z/OS DFSORT Application Programming Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Obtaining various statistics

z/OS DFSORT Application Programming Guide
SC23-6878-00

Table 1. Obtaining Various Statistics
Obtaining Various StatisticsSample code
     MODE STOP
     VERIFY FROM(DATA1) ON(22,7,PD)
     DISPLAY FROM(DATA1) LIST(SALARIES) -
       TITLE('Employee Salaries') DATE TIME -
       HEADER('Employee Name') HEADER('Salary') -
       ON(1,20,CH)             ON(22,7,PD)      BLANK -
       AVERAGE('Average Salary')
     STATS FROM(DATA1) ON(22,7,PD)
     RANGE FROM(DATA1) ON(22,7,PD) LOWER(20000)
     RANGE FROM(DATA1) ON(22,7,PD) HIGHER(19999) LOWER(40000)
     RANGE FROM(DATA1) ON(22,7,PD) HIGHER(40000)
     OCCUR FROM(DATA1) LIST(SALARIES) -
       TITLE('Employees Receiving Each Salary') DATE TIME -
       HEADER('Salary') HEADER('Employee Count') -
       ON(22,7,PD)      ON(VALCNT)               BLANK
Assume that you specify DD statements with the following ddnames for the indicated data sets:
DATA1
A data set containing the name, salary, department, location and so on, of each of your employees. The name field is in positions 1 through 20 in character format and the salary field is in positions 22 through 28 in packed decimal format.
SALARIES
A SYSOUT data set.
You can use the ICETOOL operators in Table 1 to do the following:
MODE STOP
If an error is found while processing one of the operators, subsequent operators are not processed (that is, each operator is dependent on the success of the previous operator).
VERIFY
Prints error messages in the TOOLMSG data set identifying any invalid values in the packed decimal salary field.
DISPLAY
Prints a report with each employee's name and salary and the average for all employee salaries in the SALARIES list data set.
STATS
Prints messages in the TOOLMSG data set showing the minimum, maximum, average, and total of the individual salaries.
RANGE
The three RANGE operators print messages in the TOOLMSG data set showing the number of salaries below $20,000, from $20,000 to $39,999, and above $40,000.
OCCUR
Prints a report with each unique salary and the number of employees who receive it in the SALARIES list data set.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014