Agenda

23
Agenda • Reporting • Work on Assignment 4!

description

Agenda. Reporting Work on Assignment 4!. Printing on power systems. Printing on power systems. Output Queue. Job. Program/ Command. Spooled File. Report Layout (Printer File). Data. *FILE. *FILE. Printing Reports with COBOL. A Good Report…. Heading (a meaningful report name) - PowerPoint PPT Presentation

Transcript of Agenda

Page 1: Agenda

Agenda

• Reporting

• Work on Assignment 4!

Page 2: Agenda

Printing on power systems

Page 3: Agenda

Printing on power systems

Program/Command

Data ReportLayout(Printer File)

Job Output Queue

*FILE*FILE

Spooled File

Page 4: Agenda

Printing Reports with COBOL

Page 5: Agenda

A Good Report…

• Heading (a meaningful report name)– Date and Page Number

• Column Headings (to identify data)• Order column from left to right to highlight

significant data• Edit numbers for readability• Include Totals at end of report and groups of items• ** To identify the ‘level’ of a total• Clearly indicate the end of the report.

Page 6: Agenda

Customer AccountsHow Many Record Formats?

Customer Accounts Date: 2004-12-31 Page: 999

Date AmountCustomer: 1015 Cindy Laurin 2004-05-12 $100.00 2004-06-09 $200.00 2004-09-28 $300.00

* Totals: 1015 Cindy Laurin $600.00

Customer: 1016 Bruce Nugent 2004-01-31 $100.00

* Totals: 1016 Bruce Nugent $100.00

** Totals: All Customers $700.00*** End of Report

Page 7: Agenda

How Many Record Formats?

Heading Customer Accounts Date: 2004-12-31 Page: 999

Column Heading Date Amount

Customer Heading Customer: 1015 Cindy LaurinDetail Line 2004-05-12 $100.00Detail Line 2004-06-09 $200.00Detail Line 2004-09-28 $300.00

Customer Total * Totals: 1015 Cindy Laurin $600.00

Customer Heading Customer: 1016 Bruce NugentDetail Line 2004-01-31 $100.00

Customer Total * Totals: 1016 Bruce Nugent $100.00

Report Total ** Totals: All Customers $700.00End of Report *** End of Report

Page 8: Agenda

Record Formats

• Each Record format is defined using it’s own Group-Item in the Working Storage Section.

• Record format name is defined using the 01 level

• Fields and literals are defined using subsequent levels with Picture & Values Clauses

Page 9: Agenda

Picture Clause Review

• Define Variables

• Define how Variables are displayed

Page 10: Agenda

Editing FunctionsFunction CharacterPrinting of a / as a separator /

Printing of Decimal Point in an integer .

Suppress Leading Zeros in an integer Z

Print a Dollar Sign in front of an integer $

Print a Comma in an integer ,

Printing of + or – signs + or -

Printing of ‘Debit’ or ‘Credit’ symbols DB or CR

Printing of Spaces as separators B

Printing of Zeros as separators 0

Print Leading asterix *

Page 11: Agenda

Examples

Trans-Amount PIC S9(6)V999 Value 4565.78.

Report-Item Edited Results

PIC 9(6)V999

PIC $999999V999

PIC $ZZZ,ZZZ.99

PIC $ZZZ,ZZZ.9

Page 12: Agenda

Examples

Trans-Amount PIC S9(6)V999 Value 4565.78.

Report-Item Edited Results

PIC $ZZZ,ZZZ.99-

PIC $ZZZ,ZZZ.99CR

PIC $ZZZZZZB99

PIC $ZZZZZZ.99+

Page 13: Agenda

Examples

Trans-Amount PIC S9(6)V999 Value 4565.78-.

Report-Item Edited Results

PIC 9(6)V999

PIC $999999V999

PIC $ZZZ,ZZZ.99

PIC $ZZZ,ZZZ.9

Page 14: Agenda

Examples

Trans-Amount PIC S9(6)V999 Value 4565.78-.

Report-Item Edited Results

PIC $ZZZ,ZZZ.99-

PIC $ZZZ,ZZZ.99CR

PIC $ZZZZZZB99

PIC $ZZZZZZ.99+

Page 15: Agenda

Examples

Customer Name PIC X(20) Value ‘Cindy Laurin-Moogk’

Report Item

PIC X(20)

PIC XXXXXXXXXXBXX

Page 16: Agenda

Printing in COBOL

FILE SECTION

FD Customer-Report.

01 Print-Record-Out.

WORKING STORAGE.01 Heading-1 05 PIC X(8) Value Spaces. 05 PIC X(17) Value ‘Customer

Accounts’ 05 PIC X(5) Value Spaces. 05 PIC X(6) Value ‘Date: ‘ 05 WS-Date-Out format of date. 05 PIC X(1) Value Spaces. 05 PIC X(6) Value ‘Page: ‘. 05 WS-Page PIC 9(3).

Page 17: Agenda

Printing or Writing to a Spooled File

Detail-Line-1 PIC X(80)

VALUE ‘Cindy’s Test’

Detail-Line-2 PIC X(80)VALUE ‘COBOL Line of Code’

WRITE Print-Record-Out FROM Detail-Line-1

WRITE Print-Record-Out FROM Detail-Line-2

Page 18: Agenda

Printing or Writing to a Spooled File (using AFTER ADVANCING)

Detail-Line-1 PIC X(80)

VALUE ‘Cindy’s Test’.

Detail-Line-2 PIC X(80)VALUE ‘COBOL Line of Code’.

WRITE Print-Record-Out FROM Detail-Line-1.

WRITE Print-Record-Out FROM Detail-Line-2

AFTER ADVANCING 1 LINE.

Page 19: Agenda

Printing or Writing to a Spooled File (using BEFORE ADVANCING)

Detail-Line-1 PIC X(80)

VALUE ‘Cindy’s Test’.

Detail-Line-2 PIC X(80)VALUE ‘COBOL Line of Code’.

WRITE Print-Record-Out FROM Detail-Line-1

BEFORE ADVANCING 1 LINE.

WRITE Print-Record-Out FROM Detail-Line-2.

Page 20: Agenda

Printing or Writing to a Spooled File (using AFTER ADVANCING)

Detail-Line-1 PIC X(80)

VALUE ‘Cindy’s Test’.

Detail-Line-2 PIC X(80)VALUE ‘COBOL Line of Code’.

WRITE Print-Record-Out FROM Detail-Line-1.

WRITE Print-Record-Out FROM Detail-Line-2

AFTER ADVANCING PAGE.

Page 21: Agenda

Printing or Writing to a Spooled File (using BEFORE ADVANCING)

Detail-Line-1 PIC X(80)

VALUE ‘Cindy’s Test’.

Detail-Line-2 PIC X(80)VALUE ‘COBOL Line of Code’.

WRITE Print-Record-Out FROM Detail-Line-1

BEFORE ADVANCING PAGE.

WRITE Print-Record-Out FROM Detail-Line-2.

Page 22: Agenda

Printing or Writing to a Spooled File

Detail-Line-1 PIC X(80)

VALUE ‘Cindy’s Test’.

Detail-Line-2 PIC X(80)VALUE ‘COBOL Line of Code’.

WRITE Print-Record-Out FROM Detail-Line-1

AFTER ADVANCING 1 LINE.

WRITE Print-Record-Out FROM Detail-Line-2

BEFORE ADVANCING 1 LINE.

Page 23: Agenda

Homework?