ADD A B TO C D ---- Syntax 1
ADD B C D TO E GIVING F ---- Syntax 2
ADD CORR WS-GR1 TO WS-GR2 ---- Syntax 3
IDENTIFICATION DIVISION.
PROGRAM-ID. AV.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-N1 PIC 9(2) VALUE 15.
01 WS-N2 PIC 9(2) VALUE 10.
01 WS-N3 PIC 9(2) VALUE 15.
01 WS-N4 PIC 9(2) VALUE 20.
01 WS-NA PIC 9(2) VALUE 5.
01 WS-NB PIC 9(2) VALUE 7.
01 WS-NC PIC 9(3) VALUE 12.
01 WS-ND PIC 9(2) VALUE 10.
01 WS-NE PIC 9(3) VALUE 10.
PROCEDURE DIVISION.
ADD WS-N1 WS-N2 TO WS-N3 WS-N4.
ADD WS-NA WS-NB WS-NC TO WS-ND GIVING WS-NE.
DISPLAY "WS-N1 : " WS-N1
DISPLAY "WS-N2 : " WS-N2
DISPLAY "WS-N3 : " WS-N3
DISPLAY "WS-N4 : " WS-N4
DISPLAY "WS-NA : " WS-NA
DISPLAY "WS-NB : " WS-NB
DISPLAY "WS-NC : " WS-NC
DISPLAY "WS-ND : " WS-ND
DISPLAY "WS-NE : " WS-NE
STOP RUN.