Logo

Programming-Idioms

History of Idiom 110 > diff from v43 to v44

Edit summary for version 44 by Roie8:
New Cobol implementation by user [Roie8]

Version 43

2019-09-27, 11:25:46

Version 44

2019-09-27, 21:12:58

Idiom #110 Check if string is blank

Set boolean blank to true if string s is empty, or null, or contains only whitespace ; false otherwise.

Idiom #110 Check if string is blank

Set boolean blank to true if string s is empty, or null, or contains only whitespace ; false otherwise.

Code
IDENTIFICATION DIVISION.
PROGRAM-ID. reverse string.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 BOOLEAN-BLANK     PIC X.
   88 BLANK          VALUE "T".
   88 NOT-BLANK      VALUE "F".
PROCEDURE DIVISION.
    IF s = ' '
       SET BLANK     TO TRUE
    ELSE
       SET NOT-BLANK TO TRUE
    END-IF 	 	
STOP RUN.