Occurs clause - program, COBOL Programming

OCCURS CLAUSE - PROGRAM:

We have to write a program to demonstrate the occurs clause. Get names 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 0.

  01  name-in.

    02 name pic x(20) occurs 20 times.

  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 0 to i.

    perform disp-para n times.

  stop run.

get-para.

  accept name(i).

  add 1 to i.

disp-para.

  display name(i).

  accept key- in.

  add 1 to i.

Posted Date: 10/18/2012 1:58:25 AM | Location : United States







Related Discussions:- Occurs clause - program, Assignment Help, Ask Question on Occurs clause - program, Get Answer, Expert's Help, Occurs clause - program Discussions

Write discussion on Occurs clause - program
Your posts are moderated
Related Questions
PROGRAM TO DEMONSTRATE MERGE VERB: The two files for which a record having 2 fields viz. Account Number and Name are already available. Now Merge these two files and create a

PICTURE specification: The size of a group item is equivalent to the total of the sizes of all the subordinate elementary items. The group item class is alphanumeric. The i

DECLARATIVE and FILE STATUS Clause: The input-output exception condition in the situation of a direct access files can be handled by a declarative procedure in a manner simila

Example of constructing an arithmetic expression: An arithmetic expression may be proceeded by a + or - sign. These operations are known as unary + or unary - operators. Il

Introduction to MOVE Verb: The aim of this section is to introduce the learner how to move data from one place to the other place in the memory. This is completed with the help

ON SIZE ERROR OPTION: Whenever a size error occurs, the contents of the result field after the operation is unpredictable.  Though, the processing is not-terminated and the co

bal majduri ik kanuni apradh hai is de bavjud bache ,ghra,hotla,road, kam karn lai majbur han bacheya te mapeya nu parhai val prerit karn lai ik bashan teyar kro

Figurative Constants: The Figurative constants have several fixed names and the compiler recognizes these names and it sets up the equivalent values in the object program.

SIGN CONDITION:   The sign condition establishes whether or not the algebraic value of an operand is negative, positive or zero. The operand can be either the numeric identif

PROGRAM FOR DIVIDE VERB:   We have to write an easy program to elaborate DIVIDE verb. You can also use edit characters in the program. Identification division. Program-