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
cobol program for generate a eb bill

CONDITION - COBOL Programming: The condition is an entity which at one point of time can have only one of the two values - true or false. As we already know that, the IF verb

COBOL Words: The COBOL word can be formed by using the characters as shown below: 0-9 A-Z (a-z) - (hyphen) The rules below should be hold in forming the COBOL words.

CLOSE STATEMENT: When the processing of a file is completed, then the file may be closed. This is completed with the help of the CLOSE-verb. The form of the CLOSE statement is

Identification Division: The Identification Division is the first division of each and every COBOL source program. The paragraph PROGRAM-ID is necessary in most of the mac

Plus Sign - edit characters for numeric data: + (Plus Sign) : A plus sign is alike to minus sign except that when the item is positive, +sign will be inserted rather th

Block Size: The normal practice is to group a number of consecutive records to form that is termed as a block or a physical record. The number of records in a block is frequen

Numeric -   Literals : The numeric literal can be created with the help of digits only. It can have a sign (+ or -) and can also have a decimal point. If no sign is specifi

DIVIDE VERB: The aim of the DIVIDE verb is to divide one number by the other and to store the result.  There are few forms of this verb. One of its forms is as shown below:

PROGRAM FOR RENAMES CLAUSE: identification division. program- id. environment division. data division. working-storage section. 01 emp.      02 empdet.