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
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
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
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
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
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. | |
OlderNewer