Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
PROGRAM-ID. EXP2-25.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT IN-RENTAL-FILE ASSIGN TO DISK
ORGANIZATION IS LINE SEQUENTIAL.
SELECT IN-SALES-FILE ASSIGN TO DISK
ORGANIZATION IS LINE SEQUENTIAL.
SELECT OUT-MASTER-FILE ASSIGN TO DISK
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD IN-RENTAL-FILE
LABEL RECORDS ARE STANDARD
RECORD CONTAINS 80 CHARACTERS
VALUE OF FILE-ID IS "RENTAL.TXT"
DATA RECORD IS IN-RENTAL-REC.
01 IN-RENTAL-REC.
05 INR-ITEM-NO PIC 9(3).
05 INR-VIDEO-NAME PIC X(20).
05 INR-NO-OF-RENTALS PIC 9(3).
FD IN-SALES-FILE
LABEL RECORDS ARE STANDARD
RECORD CONTAINS 80 CHARACTERS
VALUE OF FILE-ID IS "SALES.TXT"
DATA RECORD IS IN-SALES-REC.
01 IN-SALES-REC.
05 INS-ITEM-NO PIC 9(3).
05 INS-VIDEO-NAME PIC X(20).
05 INS-NO-OF-SALES PIC 9(3).
FD OUT-MASTER-FILE
LABEL RECORDS ARE STANDARD
RECORD CONTAINS 80 CHARACTERS
VALUE OF FILE-ID IS "MASTER.TXT"
DATA RECORD IS OUT-MASTER-REC.
01 OUT-MASTER-REC.
05 OUT-ITEM-NO PIC 9(3).
05 FILLER PIC X(2).
05 OUT-VIDEO-NAME PIC X(20).
05 FILLER PIC X(2).
05 OUT-NO-OF-RENTALS PIC 9(3).
05 FILLER PIC X(2).
05 OUT-NO-OF-SALES PIC 9(3).
WORKING-STORAGE SECTION.
01 WS-WORK-AREAS.
05 ARE-THERE-MORE-RENTALS PIC X(3) VALUE 'YES'.
05 ARE-THERE-MORE-SALES PIC X(3) VALUE 'YES'.
PROCEDURE DIVISION.
100-MAIN-MODULE.
OPEN INPUT IN-RENTAL-FILE
INPUT IN-SALES-FILE
OUTPUT OUT-MASTER-FILE.
READ IN-RENTAL-FILE
AT END MOVE 'NO' TO ARE-THERE-MORE-RENTALS.
PERFORM 200-CALC-RTN
UNTIL ARE-THERE-MORE-RENTALS = 'NO'.
CLOSE IN-RENTAL-FILE
IN-SALES-FILE
OUT-MASTER-FILE.
STOP RUN.
200-CALC-RTN.
MOVE spaces TO OUT-MASTER-REC.
MOVE INR-ITEM-NO TO OUT-ITEM-NO.
MOVE INR-VIDEO-NAME TO OUT-VIDEO-NAME.
MOVE INR-NO-OF-RENTALS TO OUT-NO-OF-RENTALS.
READ IN-SALES-FILE
AT END MOVE 'NO' TO ARE-THERE-MORE-SALES.
MOVE INS-NO-OF-SALES TO OUT-NO-OF-SALES.
WRITE OUT-MASTER-REC.
READ IN-RENTAL-FILE
AT END MOVE 'NO' TO ARE-THERE-MORE-RENTALS.
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team