Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Make the following adjustments to the source code to update the report. There will be comment line indicators, a through g, to help you locate where to make the updates.Ensure the date appears on the...

1 answer below »

Make the following adjustments to the source code to update the report. There will be comment line indicators, a through g, to help you locate where to make the updates.

  1. Ensure the date appears on the report by moving the accepted current date to the heading line.
  2. Adjust the number of blank lines before the region.
  3. Adjust the number of blank lines after the region.
  4. Add spacing on the detail line to move the name file by 20 characters.
  5. Add IN-Sales to the region and grand totals
  6. Compare your output with the final completed output that was provided with the assignment. At this point they should be identical.
  7. As an extra step, include the currency symbol ($) on all sales figures, region totals and the grand total. In the sales figures within each region, the currency symbols should appear lined up.
IDENTIFICATION DIVISION.
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
PROGRAM-ID. Assignment8a.

ENVIRONMENT DIVISION.

INPUT-OUTPUT SECTION.
FILE-CONTROL.
XXXXXXXXXXSELECT INFILE
XXXXXXXXXXASSIGN
"C:CobolDataFilesInFileSales.DAT"
XXXXXXXXXXORGANIZATION IS SEQUENTIAL.
XXXXXXXXXXSELECT PRINTFILE
XXXXXXXXXXASSIGN
"C:Cobol/DataFiles/OutReportSummary_Completed.txt"
XXXXXXXXXXORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD INFILE.
XXXXXXXXXXINREC.
XXXXXXXXXXIN-REGION PIC X.
XXXXXXXXXXIN-NAME PIC X(20).
XXXXXXXXXXIN-SALES PIC 9(6)V99.
FD PRINTFILE.
XXXXXXXXXXPRINTREC XXXXXXXXXXPIC X(80).
WORKING-STORAGE SECTION.
XXXXXXXXXXWS-EDITED-DATE PIC 9999/99/99.
XXXXXXXXXXWS-EOF XXXXXXXXXXPIC X(3) VALUE "NO".
XXXXXXXXXXEND-OF-FILE XXXXXXXXXXVALUE "YES".
XXXXXXXXXXWS-REGION-TABLE.
XXXXXXXXXX XXXXXXXXXXPIC X(18) VALUE "EEASTERN NNORTHERN".
XXXXXXXXXX XXXXXXXXXXPIC X(18) VALUE "SSOUTHERNWWESTERN ".
XXXXXXXXXXWS-REGION-TABLE-REDEF REDEFINES WS-REGION-TABLE.
XXXXXXXXXXWS-REG OCCURS 4 INDEXED BY REGION-IX
XXXXXXXXXXASCENDING KEY WS-LETTER.
XXXXXXXXXXWS-LETTER PIC X.
XXXXXXXXXXWS-REGION PIC X(8).
XXXXXXXXXXWS-REGN XXXXXXXXXXVALUE LOW-VALUES.
XXXXXXXXXXWS-RG PIC X.
XXXXXXXXXX XXXXXXXXXXPIC X(7).
XXXXXXXXXXWS-DATE XXXXXXXXXXPIC 9(8).
XXXXXXXXXXWS-LINE-CNT PIC 99 VALUE 99.
XXXXXXXXXXWS-PAGE-CNT PIC 99 VALUE 0.
XXXXXXXXXXWS-RECORD-CNT PIC 9(4) VALUE 0.
XXXXXXXXXXWS-TOTALS XXXXXXXXXXCOMP VALUE LOW-VALUES.
XXXXXXXXXXWS-REGION-TOT PIC 9(8)V99.
XXXXXXXXXXWS-GRAND-TOT PIC 9(10)V99.
XXXXXXXXXXWS-HEADING-LINE.
XXXXXXXXXX XXXXXXXXXXPIC X(20) VALUE " REPORT DATED ".
XXXXXXXXXXWS-PRINT-DATE PIC 9999/99/99.
XXXXXXXXXX XXXXXXXXXXPIC X(60) VALUE SPACES.
XXXXXXXXXXWS-PRINT-PAGE-CNT PIC Z9.
XXXXXXXXXXWS-REGION-START-LINE.
XXXXXXXXXX XXXXXXXXXXPIC X(8) VALUE "REGION:".
XXXXXXXXXXWS-PRINT-REGION PIC X(8).
XXXXXXXXXXWS-DETAIL.
* d) Add spacing on the detail line to move the name file
* by 20 characters
XXXXXXXXXXWS-PRINT-NAME PIC X(40).
XXXXXXXXXXWS-PRINT-SALES PIC ZZZ,ZZ9.99.
XXXXXXXXXXWS-SPACES XXXXXXXXXXPIC X(132) VALUE SPACES.
XXXXXXXXXXWS-REGION-END-LINE.
XXXXXXXXXX XXXXXXXXXXPIC X(20) VALUE SPACES.
XXXXXXXXXX XXXXXXXXXXPIC X(27) VALUE
"TOTALS FOR THIS REGION ARE ".
XXXXXXXXXXWS-PRINT-REGION-TOTAL
XXXXXXXXXXPIC ZZ,ZZZ,ZZ9.99.
XXXXXXXXXXWS-FINAL-LINE.
XXXXXXXXXX XXXXXXXXXXPIC X(20) VALUE SPACES.
XXXXXXXXXX XXXXXXXXXXPIC X(20) VALUE "GRAND TOTAL ".
XXXXXXXXXXWS-PRINT-GRAND-TOTAL PIC Z,ZZZ,ZZZ,ZZ9.99.
PROCEDURE DIVISION.
PROG.
XXXXXXXXXXPERFORM INIT-PARA
XXXXXXXXXXPERFORM BOD-PARA
XXXXXXXXXXPERFORM END-PARA
.
INIT-PARA.
XXXXXXXXXXDISPLAY "PRINT PROGRAM STARTING"
XXXXXXXXXXOPEN INPUT INFILE
XXXXXXXXXXOUTPUT PRINTFILE
XXXXXXXXXXACCEPT WS-DATE FROM DATE YYYYMMDD
XXXXXXXXXXMOVE WS-DATE to WS-EDITED-DATE
XXXXXXXXXXDISPLAY "Date is " WS-EDITED-DATE
* a) Ensure the date appears on the report by moving the
* accepted current date to the heading line
XXXXXXXXXXREAD INFILE
XXXXXXXXXXAT END MOVE "YES" TO WS-EOF
XXXXXXXXXXEND-READ
.
BOD-PARA.
XXXXXXXXXXPERFORM PROCESS-REC UNTIL END-OF-FILE
.
END-PARA.
XXXXXXXXXXIF WS-RECORD-CNT = 0
XXXXXXXXXXDISPLAY "NO RECORDS ON INPUT FILE!"
XXXXXXXXXXEND-IF
XXXXXXXXXXPERFORM END-OF-REGION
XXXXXXXXXXMOVE WS-GRAND-TOT TO WS-PRINT-GRAND-TOTAL
XXXXXXXXXXWRITE PRINTREC FROM WS-FINAL-LINE AFTER 4
XXXXXXXXXXCLOSE INFILE
XXXXXXXXXXPRINTFILE

XXXXXXXXXXSTOP RUN
.
PROCESS-REC.
XXXXXXXXXXIF WS-LINE-CNT > 45
XXXXXXXXXXPERFORM WRITE-HEADINGS
XXXXXXXXXXEND-IF
XXXXXXXXXXIF IN-REGION UNEQUAL WS-RG
XXXXXXXXXXAND WS-REGN UNEQUAL LOW-VALUES
XXXXXXXXXXPERFORM END-OF-REGION
XXXXXXXXXXEND-IF
XXXXXXXXXXIF IN-REGION UNEQUAL WS-RG
XXXXXXXXXXPERFORM START-OF-REGION
XXXXXXXXXXEND-IF
XXXXXXXXXXADD 1 TO WS-RECORD-CNT
XXXXXXXXXXPERFORM WRITE-DETAIL
XXXXXXXXXXREAD INFILE
XXXXXXXXXXAT END MOVE "YES" TO WS-EOF
XXXXXXXXXXEND-READ
.
WRITE-HEADINGS.
XXXXXXXXXXWRITE PRINTREC FROM WS-SPACES AFTER PAGE
XXXXXXXXXXADD 1 TO WS-PAGE-CNT
XXXXXXXXXXMOVE WS-PAGE-CNT TO WS-PRINT-PAGE-CNT
XXXXXXXXXXWRITE PRINTREC FROM WS-HEADING-LINE AFTER 2
XXXXXXXXXXMOVE 2 TO WS-LINE-CNT
XXXXXXXXXXIF WS-PAGE-CNT > 1
XXXXXXXXXXPERFORM START-OF-REGION
XXXXXXXXXXEND-IF
.
END-OF-REGION.
XXXXXXXXXXMOVE WS-REGION-TOT TO WS-PRINT-REGION-TOTAL
XXXXXXXXXXMOVE 0 TO WS-REGION-TOT
* c) Adjust the number of blank lines after the region.
XXXXXXXXXXWRITE PRINTREC FROM WS-REGION-END-LINE AFTER 1
XXXXXXXXXXADD 1 TO WS-LINE-CNT
.
START-OF-REGION.
XXXXXXXXXXSEARCH ALL WS-REG
XXXXXXXXXXAT END DISPLAY "UNKNOWN REGION " IN-REGION
XXXXXXXXXXCLOSE INFILE
XXXXXXXXXXPRINTFILE
XXXXXXXXXXSTOP RUN
XXXXXXXXXXWHEN IN-REGION = WS-LETTER(REGION-IX)
XXXXXXXXXXMOVE WS-REGION(REGION-IX) TO WS-print-region
XXXXXXXXXXEND-SEARCH
XXXXXXXXXXMOVE in-region to ws-regn
* b) Adjust the number of blank lines before the region.
XXXXXXXXXXWRITE PRINTREC FROM WS-REGION-START-LINE AFTER 1
XXXXXXXXXXADD 1 TO WS-LINE-CNT
.
WRITE-DETAIL.
XXXXXXXXXXMOVE IN-NAME TO WS-PRINT-NAME
XXXXXXXXXXMOVE IN-SALES TO WS-PRINT-SALES
* e) Add IN-Sales to the region and grand totals
XXXXXXXXXXWRITE PRINTREC FROM WS-DETAIL AFTER 1
XXXXXXXXXXADD 1 TO WS-LINE-CNT
.
Answered Same Day Nov 22, 2022

Solution

Aditi answered on Nov 23 2022
55 Votes
REPORT DATED 2022/11/23
REGION: NORTHERN
MALCOLM ARNOLD 12,345.67
CAMILLE SAINT-SAENS 85,450.00
CLAUDE DEBUSSY 37,267.00
ANTONIO VIVALDI 66,660.00
KARL DITTERS 30,046.00
ROGER QUILTER 92,929.00
PERCY GRAINGER 44,449.44
TOTALS FOR THIS REGION ARE ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here