Program for perform - varying, COBOL Programming

PROGRAM FOR PERFORM - VARYING:

We have to write a program to elaborate PERFORM ...VARYING

Identification division.

Program- id. PerfVary.

Environment division.

Data division.

Working-storage section.

01 n pic 9(2) value 0.

01  i  pic 9(2) value 1.

01 sum pic 9(4) value 0.

Procedure division.

Para-1.

  Display(1 1) erase.

  Display(5 5) "Enter a Number ".

Accept n.

             Perform calc-para varying i from 1 by 1 until  i > n.

             Display(10 5) " Sum = " sum.

             Stop run.

Calc-para.

  Compute sum = sum + i.

Posted Date: 10/17/2012 7:46:21 AM | Location : United States







Related Discussions:- Program for perform - varying, Assignment Help, Ask Question on Program for perform - varying, Get Answer, Expert's Help, Program for perform - varying Discussions

Write discussion on Program for perform - varying
Your posts are moderated
Related Questions
Floating Insertion   The currency symbol ($) can emerge in multiples on the left-hand side of the picture. In this situation the character will be treated in similar way as t

.(Period or Decimal Point) : The period may be used to insert a decimal point and may not come into view more than once. Both the period and V cannot appear in similar picture

Illustration of indexed tables: Index items defined through the INDEXED phrase of the OCCURS clause are one type of indexes. There can be other type of index items that are de

INDEXED TABLES: The OCCURS clause that is used to define tables can optionally have an INDEXED phrase. This phrase involves the names of data items which are to be used as sub

COMPOUND CONDITION: The two simple conditions can be connected by the logical operators AND or OR to form a compound condition (also termed as combined condition). When two co

RENAMES CLAUSE: At times re-grouping of an elementary data items in a record may be essential so that they can belong to the original as well as to the latest group. This is o

FILE-CONTROL ENTRIES FOR THE SEQUENTIAL FILES: The characteristics of each and every files handled in a program are specified in the ENVIRONMENT DIVISION and DATA DIVISION.

PROGRAM FOR SUBTRACT VERB: We have to write a simple program to elaborate the SUBTRACT verb. You can also use edit characters in the program. Identification division. Pr

GIVING    file-name-5. The input files to be merged through the MERGE statements which are specified in the USING phrase. These files should be sequential files and should be

RELATIVE FILES: The Files that are stored on a direct access storage medium like magnetic disk are frequently known as direct access files. The COBOL supports three different