Logo

Programming-Idioms

History of Idiom 48 > diff from v58 to v59

Edit summary for version 59 by Roie8:
[Cobol] fix

Version 58

2019-09-28, 12:20:16

Version 59

2019-09-28, 12:20:47

Idiom #48 Multi-line string literal

Assign to variable s a string literal consisting in several lines of text

Idiom #48 Multi-line string literal

Assign to variable s a string literal consisting in several lines of text

Extra Keywords
multiline raw
Extra Keywords
multiline raw
Code
IDENTIFICATION DIVISION.
PROGRAM-ID. list.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 s    PIC X(20).
01 str  PIC X(5) VALUE 'COBOL'.
01 str1 PIC X(4) VALUE 'RULE'.
01 str2 PIC X(3) VALUE 'THE'.
01 str3 PIC X(5) VALUE 'WORLD'.
PROCEDURE  DIVISION.       
    STRING str ' ' str1 ' ' str2 ' ' str3 
    DELIMITED BY SIZE INTO s
STOP RUN.
Code
IDENTIFICATION DIVISION.
PROGRAM-ID. multi-line string.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 s    PIC X(20).
01 str  PIC X(5) VALUE 'COBOL'.
01 str1 PIC X(4) VALUE 'RULE'.
01 str2 PIC X(3) VALUE 'THE'.
01 str3 PIC X(5) VALUE 'WORLD'.
PROCEDURE  DIVISION.       
    STRING str ' ' str1 ' ' str2 ' ' str3 
    DELIMITED BY SIZE INTO s
STOP RUN.