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
I need help with a COBOL programming assingment. I have started the program but I need help completing the program. I have 5 errors. Here is the question. 10. Suppose your company

NONSTANDARD CLAUSES: The various clauses explained above are as per the ANSI standard. Also, most compilers provide for additional nonstandard clauses to meet the specific nec

REWRITE STATEMENT: As in the situation of a relative file, the REWRITE statement needs that the file should be opened in the I-O mode, and if the SEQENTIAL access mode is spec

NEGATED SIMPLE CONDITION: Any of the easy condition explained can be preceded by the logical operator NOT. The consequence of placing the operator NOT before an easy condition


Valid and Invalid Word - Cobol words: Valid Word             Invalid Word & Reason emp-sal                  -pay   ( it starts with a hyphen)  TOTAL MARK (blank space em

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 FOR SIZE ERROR:   We have to write an easy program to elaborate the size error option. Identification division. Program- id. sizeerr. Environment division.

SEQUENTIAL FILES WITH THE VARIABLE-LENGTH RECORDS: The Magnetic - tape or disk files can hold variable-length records. In this situation the file can have records with various

CLASS CONDITION:   The class condition establishes whether or not the value of the operand is numeric or alphabetic. The operand is numeric if it contains only the digits 0 t