Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-TABLE1.
05 WS-A OCCURS 2 TIMES INDEXED BY I.
10 WS-B PIC X(5).
10 WS-C OCCURS 1 TIMES INDEXED BY J.
15 WS-D PIC X(5).
PROCEDURE DIVISION.
MOVE 'SRINIVASANSRINIVASAN' TO WS-TABLE1.
PERFORM A-PARA VARYING I FROM 1 BY 1 UNTIL I > 2.
STOP RUN.
A-PARA.
PERFORM C-PARA VARYING J FROM 1 BY 1 UNTIL J > 1.
C-PARA.
DISPLAY 'NAME:' WS-B(I).
DISPLAY 'NAME:' WS-D(I,J).
IDENTIfication DIVISION.
PROGRAM-ID. add1.
data division.
working storage section
01 a pic 9(1).
01 b pic 9(1).
01 c pic 9(2).
PROCEDURE DIVISION.
accept a
accept b
compute c = a + b
DISPLAY 'c'
STOP RUN.