Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
48
Task/File-input-output/COBOL/file-input-output-1.cobol
Normal file
48
Task/File-input-output/COBOL/file-input-output-1.cobol
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. file-io.
|
||||
|
||||
ENVIRONMENT DIVISION.
|
||||
INPUT-OUTPUT SECTION.
|
||||
FILE-CONTROL.
|
||||
SELECT in-file ASSIGN "input.txt"
|
||||
ORGANIZATION LINE SEQUENTIAL.
|
||||
|
||||
SELECT OPTIONAL out-file ASSIGN "output.txt"
|
||||
ORGANIZATION LINE SEQUENTIAL.
|
||||
|
||||
DATA DIVISION.
|
||||
FILE SECTION.
|
||||
FD in-file.
|
||||
01 in-line PIC X(256).
|
||||
|
||||
FD out-file.
|
||||
01 out-line PIC X(256).
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
DECLARATIVES.
|
||||
in-file-error SECTION.
|
||||
USE AFTER ERROR ON in-file.
|
||||
DISPLAY "An error occurred while using input.txt."
|
||||
GOBACK
|
||||
.
|
||||
out-file-error SECTION.
|
||||
USE AFTER ERROR ON out-file.
|
||||
DISPLAY "An error occurred while using output.txt."
|
||||
GOBACK
|
||||
.
|
||||
END DECLARATIVES.
|
||||
|
||||
mainline.
|
||||
OPEN INPUT in-file
|
||||
OPEN OUTPUT out-file
|
||||
|
||||
PERFORM FOREVER
|
||||
READ in-file
|
||||
AT END
|
||||
EXIT PERFORM
|
||||
END-READ
|
||||
WRITE out-line FROM in-line
|
||||
END-PERFORM
|
||||
|
||||
CLOSE in-file, out-file
|
||||
.
|
||||
2
Task/File-input-output/COBOL/file-input-output-2.cobol
Normal file
2
Task/File-input-output/COBOL/file-input-output-2.cobol
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
*> Originally from ACUCOBOL-GT
|
||||
CALL "C$COPY" USING "input.txt", "output.txt", 0
|
||||
2
Task/File-input-output/COBOL/file-input-output-3.cobol
Normal file
2
Task/File-input-output/COBOL/file-input-output-3.cobol
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
*> Originally from Micro Focus COBOL
|
||||
CALL "CBL_COPY_FILE" USING "input.txt", "output.txt"
|
||||
Loading…
Add table
Add a link
Reference in a new issue