Menu

#1191 NULL figurative constant

GC 3.2
open
nobody
None
5 - default
2026-02-07
2026-02-07
No

It seems that the figurative constant NULL cannot be treated like all the others, such as ZERO, LOW-VALUE, etc.
In the following program, the IF wFIELD01 = NULLstatement reports a compile-time error:

invalid expression: unfinished expression

       >>SOURCE FORMAT IS FREE
ID DIVISION.
program-id. TESTNULL.
DATA DIVISION.
Working-Storage Section.
01  wFIELD01 PIC XX value NULL.
01  wFIELD02 PIC XX value LOW-VALUE.
01  wFIELD03 PIC XX value ZEROES.

PROCEDURE DIVISION.
IF wFIELD01 = LOW-VALUE 
   continue 
end-if
IF wFIELD01 = NULL 
   continue 
end-if
GOBACK.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB