Logo 
Search:

Cobol Article

Submit Article
Comments on PROGRAM TO USE REDEFINE CLAUSE
Category: Cobol (Homework Help)    Author: Amelie Hughes

PROGRAM TO USE REDEFINE CLAUSE.


Vadlamudi Mohankumar
Vadlamudi Mohankumar from IndiaNov 10
sir in the above program i am getting an error so this is corrected

* PROGRAMME FOR READING A MESSAGE
IDENTIFICATION DIVISION.
PROGRAM-ID. READ-MSG.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 W-REC.
02 W-DAYS.
05 D1 PIC X(10) VALUE "SUNDAY".
05 D2 PIC X(10) VALUE "MONDAY".
05 D3 PIC X(10) VALUE "TUESDAY".
05 D4 PIC X(10) VALUE "WEDNESDAY".
05 D5 PIC X(10) VALUE "THURSDAY".
05 D6 PIC X(10) VALUE "FRIDAY".
05 D7 PIC X(10) VALUE "SATURDAY".
02 W-DAYS1 REDEFINES W-DAYS PIC X(10) OCCURS 7 TIMES.

01 I PIC 9 VALUE 1.

PROCEDURE DIVISION.
BEGIN.

PERFORM READ-PARA VARYING I FROM 1 BY 1 UNTIL I>7.

STOP RUN.
READ-PARA.
DISPLAY " DAY- " I " = " W-DAYS1(I).


Please enter your Comment
  • Comment should be atleast 15 Characters.
  • Please put code inside [Code] your code [/Code].