It seems a program like this does not work.
PROGRAM-ID. Test.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT CountFile ASSIGN TO "count.dat"
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD CountFile.
01 CountDetails.
02 FCountA PIC 99 VALUE 0.
02 FCountB PIC 99 VALUE 0.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
Begin.
OPEN OUTPUT CountFile
ADD 1 TO FCountA
ADD 1 TO FCountB
WRITE CountDetails
CLOSE CountFile
STOP RUN.
This writes 9999 to the count.dat file. ADD works for fields in the WORKING-STORAGE SECTION but not in the FILE SECTION.
Is that true ?