This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDENTIFICATION DIVISION. | |
PROGRAM-ID. ClearRecord. | |
ENVIRONMENT DIVISION. | |
INPUT-OUTPUT SECTION. | |
FILE-CONTROL. | |
SELECT INPUT-FILE | |
ASSIGN TO DISC | |
ORGANIZATION IS LINE SEQUENTIAL | |
ACCESS MODE IS SEQUENTIAL. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDENTIFICATION DIVISION. | |
PROGRAM-ID. TotalNumbers. | |
DATA DIVISION. | |
WORKING-STORAGE SECTION. | |
01 SUB-TOTAL PIC 9(3).9(2) VALUE 0. | |
01 GRAND-TOTAL PIC 9(3).9(2) VALUE 0. | |
PROCEDURE DIVISION. | |
TOTAL-ROUTINE. | |
MOVE 345.67 TO SUB-TOTAL. | |
ADD SUB-TOTAL TO GRAND-TOTAL. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDENTIFICATION DIVISION. | |
PROGRAM-ID. TruncateNumber. | |
DATA DIVISION. | |
WORKING-STORAGE SECTION. | |
01 BIG-NUMBER PIC 9(5).9(4). | |
01 LITTLE-NUMBER PIC 9(3).9(2). | |
PROCEDURE DIVISION. | |
TRUNCATE-ROUTINE. | |
MOVE 12345.6789 TO BIG-NUMBER. | |
MOVE BIG-NUMBER TO LITTLE-NUMBER. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDENTIFICATION DIVISION. | |
PROGRAM-ID. MoveToShorterField. | |
DATA DIVISION. | |
WORKING-STORAGE SECTION. | |
01 LONG-FIELD PIC X(20). | |
01 SHORT-FIELD PIC X(10). | |
PROCEDURE DIVISION. | |
MOVE-ROUTINE. | |
MOVE "GONE WITH THE WIND" TO LONG-FIELD. | |
MOVE LONG-FIELD TO SHORT-FIELD. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDENTIFICATION DIVISION. | |
PROGRAM-ID. MoveNumbers. | |
DATA DIVISION. | |
WORKING-STORAGE SECTION. | |
01 NUM-FIELD1 PIC 9(2). | |
02 NUM-FIELD2 PIC 9(2). | |
03 NUM-FIELD3 PIC 9(4). | |
04 NUM-FIELD4 PIC 9(4). | |
PROCEDURE DIVISION. | |
MOVE-ROUTINE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if yes-no-flag = 'y' | |
perform yes-routine | |
else | |
perform no-routine. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSPECT FAVORITE-FOOTBALL-TEAM CONVERTING | |
"abcdefghijklmnopqrstuvwxyz" TO | |
"ABCDEFGHIJKLMNOPQRSTUVWXYZ". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSPECT FRUSTRATION REPLACING INITIAL "U" BY "A". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MOVE 0 TO CTR. | |
INSPECT TEXT-FIELD TALLYING CTR FOR ALL ZEROES. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSPECT PART-NUMBER REPLACING INTIAL "*" BY "-". |