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
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
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
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. 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. 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. 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
READ-ROUTINE. | |
INITIALIZE INPUT-RECORD. | |
READ INPUT-FILE AT END GO TO END-ROUTINE. | |
INITIALIZE OUTPUT-RECORD. | |
MOVE INPUT-RECORD TO OUTPUT-RECORD. | |
WRITE OUTPUT-RECORD. | |
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. MoveCorresponding. | |
DATA DIVISION. | |
WORKING-STORAGE SECTION. | |
01 OLD-RECORD. | |
05 EMPLOYEE-NAME PIC X(25). | |
05 EMPLOYEE-ADDRESS PIC X(30). | |
05 EMPLOYEE-CITY PIC X(20). | |
05 EMPLOYEE-STATE PIC XX. | |
05 EMPLOYEE-ZIP PIC X(10). |
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 EMPLOYEE-NAME OF OLD-RECORD TO EMPLOYEE-NAME OF NEW-RECORD. | |
MOVE EMPLOYEE-ADDRESS OF OLD-RECORD TO EMPLOYEE-ADDRESS OF NEW-RECORD. | |
MOVE EMPLOYEE-CITY OF OLD-RECORD TO EMPLOYEE-CITY OF NEW-RECORD. | |
MOVE EMPLOYEE-STATE OF OLD-RECORD TO EMPLOYEE-STATE OF NEW-RECORD. | |
MOVE EMPLOYEE-ZIP OF OLD-RECORD TO EMPLOYEE-ZIP OF NEW-RECORD. | |
MOVE DEPT-NO OF OLD-RECORD TO DEPT-NO OF NEW-RECORD. | |
MOVE EMPLOYEE-NO OF OLD-RECORD TO EMPLOYEE-NO OF NEW-RECORD. | |
MOVE EMPLOYEE-HIRE-DATE OF OLD-RECORD TO EMPLOYEE-HIRE-DATE OF NEW-RECORD. | |
MOVE EMPLOYEE-BIRTH-DATE OF OLD-RECORD TO EMPLOYEE-BIRTH-DATE OF NEW-RECORD. | |