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

  English sentences into statements of predicate calculus

Translate the following English sentences into statements of predicate calculus. All programmers enjoy discrete mathematics. Some integers are not odd

  Based on the keston 2013 article in the electronic reserve

write a 200- to 300-word short-answer response to the followingbased on the keston 2013 article in the electronic

  Write program to create n-dimensional array on th runtime

Write a program to create an n-dimensional array on the runtime with the help of pointers. The user will enter on the run time that how many dimensions are required.

  Wilkerson-irwin algorithm to minimize mean tardiness

Write a program to implement the Wilkerson-Irwin algorithm to minimize mean tardiness.

  Create test-methods for each operations

Write the methods to pass the tests. A significant portion of your score will be based on the effectiveness and thoroughness of your test-methods.

  Discussion: html/css

Discussion: HTML/CSS,  "JavaScript Placement"  Please respond to the following: Compare and contrast the process of adding JavaScript and a Cascading Style Sheet to a Website. Determine if they can be used simultaneously in a page. If so, explain wh..

  Give a flowchart and a pseudocode for the program.

The type field holds the type of animal that is the pet. Example values are "Dog", "Cat", and "Bird".

  Use for loop to calculate sum of squares of numbers

Given int variables k and total which have already been declared, use the for loop to calculate sum of squares of first 50 counting numbers, and store this value in total.

  Create program in visual studio-produce summary of ammounts

Create the program in Visual Studio, C#, 3.5 .Net that will produce the summary of amounts due for Pat's Auto Repair Shop. Display splash screen first.

  What are advantages of using menus in a gui application

What are advantages of using menus in a GUI application? Design a menu structure for a program you would find useful in your work or hobbies. Write and post the code for the menu creation

  Create a project in xcode

Create a new project in XCode using the Mac OS X/Command Line Tool template

  Write application that allows users to enter student id

Write an application that enables users to enter student ID and three exam scores. Provide a method to compute and return the overall exam average.

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