Skip to content

Commit

Permalink
start chapter 12
Browse files Browse the repository at this point in the history
  • Loading branch information
aaevan committed Dec 28, 2020
1 parent 9a0cca8 commit 7c3307e
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 0 deletions.
18 changes: 18 additions & 0 deletions fdbill01.cbl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
*------------------------------------------
* FDBILL01.CBL
* Primary Key - BILL-NUMBER
* BILL-DATE, BILL-DUE and BILL-PAID
* are all dates in CCYYMMDD format.
*------------------------------------------
FD BILL-FILE
LABEL RECORDS ARE STANDARD.
01 CHECK RECORD.
05 BILL-NUMBER PIC 9(6).
05 BILL-DATE PIC 9(8).
05 BILL-DUE PIC 9(8).
05 BILL-AMOUNT PIC S9(6)V99.
05 BILL-INVOICE PIC X(15).
05 BILL-VENDOR PIC 9(5).
05 BILL-NOTES PIC X(30).
05 BILL-PAID PIC 9(8).

16 changes: 16 additions & 0 deletions fdvnd01.cbl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*------------------------------------------
* FNDVND01.CBL
*------------------------------------------
FD VENDOR-FILE
LABEL RECORDS ARE STANDARD.
01 VENDOR-RECORD.
05 VENDOR-NUMBER PIC 9(5).
05 VENDOR-NAME PIC X(30).
05 VENDOR-ADDRESS-1 PIC X(30).
05 VENDOR-ADDRESS-2 PIC X(30).
05 VENDOR-CITY PIC X(20).
05 VENDOR-STATE PIC X(2).
05 VENDOR-ZIP PIC X(10).
05 VENDOR-CONTACT PIC X(30).
05 VENDOR-PHONE PIC X(15).

22 changes: 22 additions & 0 deletions fdvnd02.cbl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
*--------------------------------
* FDVND02.CBL
* Primary Key - VENDOR-NUMBER
* VENDOR-ADDRESS-2 not always used
* so may be SPACES
* VENDOR-PHONE is usually the
* number for VENDOR-CONTACT
* All fields should be entered in
* UPPER case.
*--------------------------------
FD VENDOR-FILE
LABEL RECORDS ARE STANDARD.
01 VENDOR-RECORD.
05 VENDOR-NUMBER PIC 9(5).
05 VENDOR-NAME PIC X(30).
05 VENDOR-ADDRESS-1 PIC X(30).
05 VENDOR-ADDRESS-2 PIC X(30).
05 VENDOR-CITY PIC X(20).
05 VENDOR-STATE PIC X(2).
05 VENDOR-ZIP PIC X(10).
05 VENDOR-CONTACT PIC X(30).
05 VENDOR-PHONE PIC X(15).
9 changes: 9 additions & 0 deletions slvnd01.cbl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*------------------------------------------
* SLVND01.CBL
*------------------------------------------
SELECT VENDOR-FILE
ASSIGN TO "vendor"
ORGANIZATION IS INDEXED
RECORD KEY IS VENDOR-NUMBER
ACCESS MODE IS DYNAMIC.

36 changes: 36 additions & 0 deletions vdchk01.cbl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
*----------------------------
* FDCHK01.CBL
* Primary Key - CHECK-KEY
* if you use more than 1 check
* account to pay bills, using
* check numbers only may
* cause duplicates.
* CHECK-INVOICE is the vendor's
* invoice that is check paid
* and can be blank.
* CHECK-CLEARED = "Y" once the
* check is reported cashed
* on a bank statement. Setting
* this flag is done in the
* check clearance program
* chkclr.cbl.
* CHECK-REFERENCE for any notes
* about the check.
* CHECK-VENDOR can be zero for a
* general check to someone who
* is not a regular vendor, but
* CHECK-REFERENCE should be
* filled in with payee.
*----------------------------
FD CHECK-FILE
LABEL RECORDS ARE STANDARD.
01 CHECK-RECORD.
05 CHECK-KEY.
10 CHECK-ACCOUNT PIC 9(10).
10 CHECK-NUMBER PIC 9(6).
05 CHECK-AMOUNT PIC S9(6)V99.
05 CHECK-INVOICE PIC X(15).
05 CHECK-VENDOR PIC 9(5).
05 CHECK-REFERENCE PIC X(30).
05 CHECK-CLEARED PIC X.

26 changes: 26 additions & 0 deletions vndbld02.cbl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
IDENTIFICATION DIVISION.
PROGRAM-ID. VNDBLD02.
*------------------------------------------
* Create an Empty Vendor File.
*------------------------------------------
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.

COPY "slvnd01.cbl".

DATA DIVISION.
FILE SECTION.

COPY "fdvnd01.cbl".

WORKING-STORAGE SECTION.

PROCEDURE DIVISION.
PROGRAM-BEGIN.
OPEN OUTPUT VENDOR-FILE.
CLOSE VENDOR-FILE.

PROGRAM-DONE.
STOP RUN.

0 comments on commit 7c3307e

Please sign in to comment.