Calculate the current commission that the dealer receives

Assignment Help Programming Languages
Reference no: EM13996656

Program:

For this assignment you will produce a sequential update program using techniques similar to the program I posted at the end of this homework. You are given two files, a "master" file with dealer information called Dealer.dat with record specification of:

01 Dealer-Record.
03 Dealer-NumberPic X(8).
03 Dealer-Name.
05 Last-NamePic X(25).
05 First-NamePic X(15).
05 Middle-NamePic X(10).
03 Address-Line-1Pic X(38).
03 CityPic X(21).
03 State-Or-CountryPic X(5).
03 Postal-CodePic 9(5).
03 Consignment-PercentPic 9(3).
03 Last-Sold-AmountPic S9(7)v99.
03 Last-Sold-DatePic 9(8).
03 Sold-To-DatePic S9(7)v99.
03 Commission-To-DatePic S9(7)v99.

and a transaction file called Trans.dat with record specification of:

01 Trans-Record.
03 Transaction-DatePic 9(8).
03 Transaction-Text.
05 Transaction-TypePic X(4).
05 Transaction-Dealer-NumberPic X(8).
03 Transaction-PricePicS9(7)v99.
03 Transaction-QtyPic 9(3).

Your task is to apply the transactions in Trans.dat to the master file Dealer.dat to produce a "new master" called Dealer-Out.dat. Transactions whose dealer number do not match a dealer number in Dealer.dat will be copied intact to a file Reject.dat.

During the apply step, if the Dealer-Number in Dealer-Record matches the Transaction-Dealer-Number in Trans-Record you will do the following:

• Calculate the value of the current transaction as the Transaction-Qty times the Transaction-Price.

• Update the Sold-To-Date in Dealer-Record by adding in the value of the current transaction.

• Calculate the current commission that the dealer receives by multiplying the value of the current transaction by the Consignment-Percent. Note that the Consignment-Percent is given as a number for 1 to 100, so you need to turn it into a decimal quantity.

• Update the Commission-To-Date by adding in the current commission.

If the date of the transaction is more recent than Last-Sold-Date, then 1) updateLast-Sold-Date to be the date of the transaction (in its original format), and 2)update Last-Sold-Amount to be the same as the value of the current transaction.

(Note that to do a date comparison, you need to reformat the date as YYYYMMDD, and compare the two dates using that format).

You will also keep a running total of:

• The number of transactions processed

• The number of rejected transactions, and

• The total of the commissions paid to dealers.

Prior to exiting the program, you should print these out to the display, so you should get an output similar to the following:

Begin Prog03
Processing Complete
Transactions Read 154
Transactions Rejected 149
Total of Commissions Paid 1,469.10

You should pass in the following

  • Your Prog03.cbl file
  • Your Dealer-Out.dat file
  • Your Reject.dat file

       IDENTIFICATION DIVISION.

       PROGRAM-ID.  SEQ1000.

       ENVIRONMENT DIVISION.

       INPUT-OUTPUT SECTION.

       FILE-CONTROL.

           SELECT RCTTRAN  ASSIGN TO "RCTTRAN.DAT"

               ORGANIZATION IS LINE SEQUENTIAL.

           SELECT OLDMAST  ASSIGN TO "OLDMAST.DAT"

               ORGANIZATION IS LINE SEQUENTIAL.

           SELECT NEWMAST  ASSIGN TO "NEWMAST.DAT"

               ORGANIZATION IS LINE SEQUENTIAL

               FILE STATUS IS NEWMAST-FILE-STATUS.                  

           SELECT ERRTRAN  ASSIGN TO "ERRTRAN.DAT"

               ORGANIZATION IS LINE SEQUENTIAL

               FILE STATUS IS ERRTRAN-FILE-STATUS.

       DATA DIVISION.

       FILE SECTION.

FD  RCTTRAN.

01  TRANSACTION-RECORD      PIC X(23).

FD  OLDMAST.

01  OLD-MASTER-RECORD       PIC X(70).

FD  NEWMAST.

01  NEW-MASTER-RECORD       PIC X(70).

FD  ERRTRAN.

01  ERROR-TRANSACTION       PIC X(23).

       WORKING-STORAGE SECTION.

01  SWITCHES.

05  FIRST-EXECUTION-SWITCH          PIC X   VALUE "Y".

88  FIRST-EXECUTION                     VALUE "Y".

05  ALL-RECORDS-PROCESSED-SWITCH    PIC X   VALUE "N".

88  ALL-RECORDS-PROCESSED               VALUE "Y".

01  FILE-STATUS-FIELDS.

05  NEWMAST-FILE-STATUS     PIC XX.

88  NEWMAST-SUCCESSFUL          VALUE "00".

05  ERRTRAN-FILE-STATUS     PIC XX.

88  ERRTRAN-SUCCESSFUL          VALUE "00".

01  RECEIPT-TRANSACTION.

05  RT-ITEM-NO              PIC X(5).

05  RT-VENDOR-NO            PIC X(5).

05  RT-RECEIPT-DATE         PIC X(8).

05  RT-RECEIPT-QUANTITY     PIC S9(5).

01  INVENTORY-MASTER-RECORD.

05  IM-ITEM-NO              PIC X(5).

05  IM-DESCRIPTIVE-DATA.

10  IM-ITEM-DESC        PIC X(40).

10  IM-UNIT-COST        PIC S9(3)V99.

10  IM-UNIT-PRICE       PIC S9(3)V99.

05  IM-INVENTORY-DATA.

10  IM-REORDER-POINT    PIC S9(5).

10  IM-ON-HAND          PIC S9(5).

10  IM-ON-ORDER         PIC S9(5).

       PROCEDURE DIVISION.

       000-UPDATE-INVENTORY-MASTER.

           OPEN INPUT  RCTTRAN

                       OLDMAST

                OUTPUT NEWMAST

                EXTEND ERRTRAN.

           MOVE LOW-VALUE TO IM-ITEM-NO.

           PERFORM 300-PROCESS-RECEIPT-TRAN

               UNTIL ALL-RECORDS-PROCESSED.

           CLOSE RCTTRAN

                 OLDMAST

                 NEWMAST

                 ERRTRAN.

           STOP RUN.

       300-PROCESS-RECEIPT-TRAN.

           PERFORM 310-READ-RECEIPT-TRANSACTION.

           PERFORM 320-PROCESS-INVENTORY-MASTER

               UNTIL IM-ITEM-NO >= RT-ITEM-NO.

           IF      IM-ITEM-NO = HIGH-VALUE

               AND RT-ITEM-NO = HIGH-VALUE

               SET ALL-RECORDS-PROCESSED TO TRUE

           ELSE

               IF IM-ITEM-NO = RT-ITEM-NO

                   PERFORM 350-APPLY-RECEIPT-TRANSACTION

               ELSE

                   PERFORM 360-WRITE-ERROR-TRANSACTION.

       310-READ-RECEIPT-TRANSACTION.

           READ RCTTRAN INTO RECEIPT-TRANSACTION

               AT END

                   MOVE HIGH-VALUE TO RT-ITEM-NO.

       320-PROCESS-INVENTORY-MASTER.

           IF FIRST-EXECUTION

               PERFORM 330-READ-OLD-MASTER

               MOVE "N" TO FIRST-EXECUTION-SWITCH

           ELSE

               PERFORM 340-WRITE-NEW-MASTER

               PERFORM 330-READ-OLD-MASTER.

       330-READ-OLD-MASTER.

           READ OLDMAST INTO INVENTORY-MASTER-RECORD

               AT END

                   MOVE HIGH-VALUE TO IM-ITEM-NO.

       340-WRITE-NEW-MASTER.

           WRITE NEW-MASTER-RECORD FROM INVENTORY-MASTER-RECORD.

           IF NOT NEWMAST-SUCCESSFUL

               DISPLAY "WRITE ERROR ON NEWMAST FOR ITEM NUMBER "

                   IM-ITEM-NO

               DISPLAY "FILE STATUS CODE IS " NEWMAST-FILE-STATUS

               SET ALL-RECORDS-PROCESSED TO TRUE.

       350-APPLY-RECEIPT-TRANSACTION.

           ADD RT-RECEIPT-QUANTITY TO IM-ON-HAND.

           SUBTRACT RT-RECEIPT-QUANTITY FROM IM-ON-ORDER.

       360-WRITE-ERROR-TRANSACTION.

           WRITE ERROR-TRANSACTION FROM RECEIPT-TRANSACTION.

           IF NOT ERRTRAN-SUCCESSFUL

               DISPLAY "WRITE ERROR ON ERRTRAN FOR ITEM NUMBER "

                   RT-ITEM-NO

               DISPLAY "FILE STATUS CODE IS " ERRTRAN-FILE-STATUS

               SET ALL-RECORDS-PROCESSED TO TRUE.

Attachment:- Dealer.rar

Reference no: EM13996656

Questions Cloud

Create pivot tables and pivot charts to analyze sales : In this project you will create pivot tables and pivot charts to analyze sales, customer and product data. Cleanse the data- Open Pivot Analysis Raw Data and save it as Pivot Analysis your name completed. Review and interpret the data. Resize and/or ..
Identify and discuss the four goals of the new medicare : The authors suggest that the CMS will need a broader strategy to accomplish its mission. List and discuss at least 3 recommendations for shaping this strategy. Which one do you feel will achieve the most good?
How much ice remains when the mixture reaches equilibrium : Does all the ice melt? If so, what is the final temperature of the water? If not, how much ice remains when the mixture reaches equilibrium.
Determine the maximum speed of the mass : A 400g mass on a spring has a speed of 95.4cm/s when it's displacement is 3.0cm and 71.4 cm/s when it's displacement is 6.0 cm what is the maximum speed of the mass?
Calculate the current commission that the dealer receives : CSDP241 Spring, 2016 - Produce a sequential update program using techniques similar to the program given posted at the end of this homework.
How much water must be circulated in the lcvg to remove : During a strenuous period of extravehicular activity, an astronaut generates 2.0 MJ of heat per hour, which must be removed by means of the liquid cooling and ventilating garment (LCVG) worn under the spacesuit. How much water must be circulated ..
Analyze the services offered by the web hosting : As a web developer, choosing an appropriate hosting provider for your client or business is one of the most important steps in the development process. Analyze the services offered by the following web hosting providers: eHost and bluehost
Dtetermine the charge on the particle : The 4000 V equipotential surface is 20.0cmfarther from a positively charged particle than the 5000 V equipotential surface. What is the charge on the particle?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd