-
Notifications
You must be signed in to change notification settings - Fork 2
/
COPIER.txt
41 lines (40 loc) · 1.43 KB
/
COPIER.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
IDENTIFICATION DIVISION.
PROGRAM-ID.
COPIER.
************************************************************
* TAKES AN 80 BYTE FILE AND COPIES IT TO ANOTHER FILE *
************************************************************
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT CARDS ASSIGN TO CARDS.
SELECT PRINTER ASSIGN TO PRINTER.
*
DATA DIVISION.
FILE SECTION.
FD CARDS
LABEL RECORDS ARE OMITTED.
01 CARD-IN-RECORD PICTURE X(80).
FD PRINTER
LABEL RECORDS ARE OMITTED.
01 LINE-OUT-RECORD PICTURE X(80).
WORKING-STORAGE SECTION.
01 EOF-FLAG PICTURE XXX.
PROCEDURE DIVISION.
MAIN-LINE-ROUTINE.
OPEN INPUT CARDS
OUTPUT PRINTER.
MOVE 'NO' TO EOF-FLAG.
* DO A PRIMARY READ BEFORE LOOP... SET EOF FLAG
READ CARDS
AT END MOVE 'YES' TO EOF-FLAG .
PERFORM PROCESS-WRITE-READ-PARAGRAPH
UNTIL EOF-FLAG = 'YES'.
CLOSE CARDS
PRINTER.
STOP RUN.
PROCESS-WRITE-READ-PARAGRAPH.
MOVE CARD-IN-RECORD TO LINE-OUT-RECORD.
WRITE LINE-OUT-RECORD.
READ CARDS
AT END MOVE 'YES' TO EOF-FLAG.