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
ACCEPT WS-CCYYMMDD FROM CENTURY-DATE. | |
MOVE 30 TO WS-DAYS. | |
MOVE 0 TO WS-DATE-TEMP. | |
MOVE FUNCTION INTEGER-OF-DATE (WS-DATE-IN-NUM) TO WS-DATE-TEMP. | |
COMPUTE WS-DATE-TEMP = WS-DATE-TEMP + WS-DAYS. | |
MOVE FUNCTION DATE-OF-INTEGER (WS-DATE-TEMP) TO WS-DATE-OUT-NUM. | |
MOVE WS-DATE-OUT TO OUTPUT-DATE. | |
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
ADD-DAYS. | |
MOVE 0 TO WS-DATE-TEMP. | |
MOVE FUNCTION INTEGER-OF-DATE (WS-DATE-IN-NUM) TO WS-DATE-TEMP. | |
COMPUTE WS-DATE-TEMP = WS-DATE-TEMP + WS-DAYS. | |
MOVE FUNCTION DATE-OF-INTERGER (WS-DATE-TEMP) TO WS-DATE-OUT-NUM. | |
ADD-DAYS-EXIT. | |
EXIT. |
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
01 WS-DATE-IN PIC X(8). | |
01 WS-DATE-IN-NUM REDEFINES WS-DATE-IN PIC 9(8). | |
01 WS-DATE-OUT. | |
05 WS-DATE-OUT-CC PIC XX. | |
05 WS-DATE-OUT-YY PIC XX. | |
05 WS-DATE-OUT-MM PIC XX. | |
05 WS-DATE-OUT-DD PIC XX. | |
01 WS-DATE-OUT-NUM REDEFINES WS-DATE-OUT PIC 9(8). | |
01 WS-DATE-TEMP PIC 9(8) VALUE 0. | |
01 WS-DAYS PIC 9(3) VALUE 0. |
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-IT. | |
MOVE PRICE-EACH-TEXT (1:3) TO TEXT-FIELD (1:3). | |
MOVE "." TO TEXT-FIELD (4:1). | |
MOVE PRICE-EACH-TEXT (4:2) TO TEXT-FIELD (5:2). | |
INSPECT TEXT-FIELD REPLACING LEADING ZEROES BY SPACES. | |
MOVE SPACES TO TEXT-FIELD2. | |
MOVE 0 TO TEXT-SUB, TEXT-SUB2. | |
PERFORM DROP-LEADING-ZEROES THRU DROP-LEADING-ZEROES-EXIT. | |
DROP-LEADING-ZEROES. | |
ADD 1 TO TEXT-SUB. |
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. READ-CSV. | |
ENVIRONMENT DIVISION. | |
INPUT-OUTPUT SECTION. | |
SELECT INPUT-FILE | |
ASSIGN TO DISC | |
ORGANIZATION IS LINE SEQUENTIAL | |
ACCESS MODE IS SEQUENTIAL. | |
SELECT 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. UCASE2LCASE. | |
ENVIRONMENT DIVISION. | |
WORKING-STORAGE SECTION. | |
01 TEXT-STRING PIC X(25). | |
PROCEDURE DIVISION. | |
START-ROUTINE. | |
MOVE "this is a text string" TO TEXT-STRING. | |
INSPECT TEXT-STRING 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
IDENTIFICATION DIVISION. | |
PROGRAM-ID. UCASE2LCASE. | |
ENVIRONMENT DIVISION. | |
WORKING-STORAGE SECTION. | |
01 TEXT-STRING PIC X(25). | |
PROCEDURE DIVISION. | |
START-ROUTINE. | |
MOVE "THIS IS A TEXT STRING" TO TEXT-STRING. | |
INSPECT TEXT-STRING 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
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. | |
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
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. | |
NewerOlder