Program of occurs clause, COBOL Programming

OCCURS CLAUSE - PROGRAM:

We have to write a program to elaborate occurs clause. Get names and marks of the students and show them on the screen.

  identification division.

  program- id.

  environment division.

  data division.

  working-storage section.

  01  n  pic  9(2) value 0.

  01  i  pic  9(2) value 1.

  01  stu-det.

     02 stu-rec occurs 10 times.

    03 name pic x(20).

    03 mark pic 9(3).

  01  key- in pic x value space.    

 

  procedure division.

  p-1.

    display(1 1) erase.

    display(3 5) "Enter How many times".

    accept n.

    display(1 1) erase.

    perform get-para n times.

    display(1 1) erase.

    move 1 to i.

    perform disp-para n times.

    stop run.

  get-para.

    accept name(i).

    accept mark(i).

    add 1 to i.

  disp-para.

    display name (i).

    display mark (i).

    accept key- in.

    add 1 to i.

Posted Date: 10/18/2012 1:59:16 AM | Location : United States







Related Discussions:- Program of occurs clause, Assignment Help, Ask Question on Program of occurs clause, Get Answer, Expert's Help, Program of occurs clause Discussions

Write discussion on Program of occurs clause
Your posts are moderated
Related Questions
OPEN statement: We know that the processing of a file should start with the execution of an OPEN statement. The file can be opened in any one of the 4 open modes - INPUT, OUTP

RULES OF REDEFINES CLAUSE The rules shown below govern the use of the REDEFINES clause: (i) The level-number of data-name-1 and data-name-2 should be identical. (ii) Exce

THE SIMPLE SORT VERB: The process of sequencing the records in some preferred manner is termed as sorting. The Sorting is done upon some key data item in the record. For illus

Selection of file Organization: While designing a file, the programmer should select an appropriate association for a file. The order in which the choice is to be made is as s

Introduction to COBOL: In the year 1959, a new language named the COBOL ( CO mmon B usiness O riented L anguage) was introduced remembering the business purpose application

Example of Class condition: Let the BASIC-PAY be a data name in the card record defined with picture 9(5) V99. By reading the card we can test the value of the BASIC-PAY to ma

Name the divisions in a COBOL program are given below DENTIFICATION DIVISION DATA DIVISION ENVIRONMENT DIVISION PROCEDURE DIVISION.

Occurs Clause: Let us establish tables with the help of an illustration. Assume that there are ten different types of income-tax rates that are read from some input medium and

PROGRAM FOR MOVE CORRESPONDING: We have to write a simple program to demonstrate Move Corresponding. identification division.   program- id.   environment division.

Illustration of nested if statement: Consider the nested sentence which is as shown below: The IF-ELSE pairs in this sentence can be detected by applying the rule whic