Previous Topic: Edit ParametersNext Topic: Process Parameters


Coding Examples of Output Definition Parameters

Samples of CA Culprit code using OUTPUT, SORT, title, and edit parameters are shown and described in the following pages.

Example 1

01OUT 80 400  D  PS(3375) DD=SYS021,21
01SORT  DEPARTMENT SALARY
0151*010 DEPARTMENT    SZ=20
0151*020 EMP-NAME      SZ=25
0151*030 SALARY        SZ=10 FP

Output records are directed to a sequential file in a z/VSE environment. The records are 80 bytes long with 5 records to a block. SYS021 is stored on logical unit 21, a 3375 disk volume.

Control break codes are not specified on the SORT parameter for the following reasons:

A title and header lines for Report 01 are also omitted because the output records are directed to a sequential file; title and header lines are usually specified for printed reports.

Each detail line for Report 01 contains three columns of information. The first two output fields contain alphanumeric data; the output field for SALARY contains a signed packed decimal number.

Example 2

01SORT DEPARTMENT,-,SALARY,D
013EMPLOYEE SALARIES BY DEPARTMENT
0151*010 DEPARTMENT    SZ=20      HR
0151*020 EMP-NAME      SZ=25      HH 'EMPLOYEE NAME'
0151*030 SALARY     F$ SZ=10 DP=2 HF

This example is similar to the previous example, except that the output is printed. Since an OUTPUT parameter is not included, the output is a printed report with 132 characters per line and 55 lines per page. The detail lines for Report 01 sort by salary in descending order within each department. Each time the department changes, the total salary for the department prints followed by two blank lines; the control break is forced by the control break code associated with DEPARTMENT.

The following figure shows a page of output for Report 01. It contains a title line, header lines (specified by the header origin codes on the type 5 edit parameters), and total lines (automatically generated for the SALARY field). SALARY is edited according to the edit options specified on the type 5 edit parameter.

REPORT NO. 01 EMPLOYEE SALARIES BY DEPARTMENT mm/dd/yy PAGE 2 DEPARTMENT EMPLOYEE NAME SALARY INTERNAL SOFTWARE PERCY GRANGER $34,500.00 INTERNAL SOFTWARE JANE DOUGH $33,000.00 INTERNAL SOFTWARE JAMES GALLWAY $33,000.00 INTERNAL SOFTWARE VLADIMIR HEAROWITZ $33,000.00 INTERNAL SOFTWARE RALPH TYRO $20,000.00 $390,500.00 PERSONNEL ELEANOR PEOPLES $80,000.00 PERSONNEL MADELINE ORGRATZI $39,000.00 PERSONNEL CYNTHIA JOHNSON $13,500.00 PERSONNEL TOM FITZHUGH $13,000.00 $145,500.00 PUBLIC RELATIONS MONTE BANK $80,000.00 PUBLIC RELATIONS LAURA PENMAN $39,000.00 PUBLIC RELATIONS CHARLES BOWER $38,500.00 PUBLIC RELATIONS BETSY ZEDI $37,000.00 PUBLIC RELATIONS JOCK JACKSON $34,000.00 PUBLIC RELATIONS MICHAEL ANGELO $18,000.00 PUBLIC RELATIONS CAROL MCDOUGALL $18,000.00 $264,500.00 THERMOREGULATION ROGER WILCO $80,000.00 THERMOREGULATION PHINEAS FINN $45,000.00 THERMOREGULATION TERRY CLOTH $38,000.00 THERMOREGULATION MARK TIME $33,000.00 THERMOREGULATION JOE KASPAR $31,000.00 $227,000.00 $2,522,500.00

Example 3

INPUT 15000 F 30000 PS DD=SYS010
REC PART1          1  13000
REC PART2      13001   1999
01OUTPUT 15100  D  PS DD=SYS020
01510001 PART1
0151     'TECHNICAL RESEARCH'  COLUMN=13001
0151     PART2                 COLUMN=13021

This example illustrates how to insert a field into a long record. The input is a sequential file assigned to ddname SYS010 in the z/OS JCL. The input file contains fixed-length 15,000-byte records.

The OUTPUT parameter defines a sequential output file that is to contain detail records 15,100 bytes in length. The edit parameters define the records. The output records contain: