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
Direct Organization: Besides the relative or indexed organization, also a direct access file can be designed to have what is termed as direct organization.  In this organizati

FILE-CONTROL: The FILE-CONTROL paragraph names each and every file and identifies the first medium through file control entries. The basic format of a file control entry is gi

PROGRAM FOR SIMPLE PERFORM: We have to write a program to elaborate simple PERFORM statement Identification division. Program- id.  Perf1. Environment division. Da

Illustration of Divide verb: (a) DIVIDE 5 INTO A. If the value of A is 20, then after execution of this statement the value of A will be 4. The older value of A will be los

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

FILE DESCRIPTION- FIXED-LENGTH RECORDS: The normal characteristics of a file are explained in the file description (FD) entry of the DATA DIVISION.

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

Illustration of Search verb: To illustrate the other use of SEARCH verb, assume we wish to search the similar tab to find the number of persons whose deposited amount is more

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

File Activity: The file activity is a measure of the proportion of records processed during an update run. Therefore we define the activity ration as shown below. Activi