In this code, I'd like to ACCEPT
and DISPLAY
the 01 level D
variable. While the 05 level D
is easy, D OF F
, is there a way to specify the 01 level D
?
The obvious solution is “just change the variable name”, but hoping there's a better way!
IDENTIFICATION DIVISION.
PROGRAM-ID. DISAMBIGUATION-ISSUE.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 D VALUE PIC 9(8).
01 F.
05 Y PIC 9(4).
05 M PIC 9(2).
05 D PIC 9(2).
PROCEDURE DIVISION.
*> Errors here, D is ambiguous
ACCEPT D.
DISPLAY "Date: " D.
STOP RUN.