Program for perform - varying, COBOL Programming


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.


  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.


  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
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

Example of condition names: The illustration below is of the use of the condition names  77  MARITAL-STATUS     PIC    9   88  SINGLE    VALUE    IS     ZERO   88  MA

File volatility: File volatility associates to the number of times the updating of records are needed during some time period. File interrogation: Some files hold re

Program for Sequential File Creation & Rewriting  We have to write a program to create a Length file with just two fields: l (Length) and l-c (Length-Code). Add a few records.

Second form of Divide verb: The second form of this verb is as shown below: In this situation the identifier-1 or numeric- literal-1 will be divided by identifier-2 or

Label Records / Disk Directory: The most important information stored in the header label is what is termed as the file title. In the situation of magnetic-disk files the labe

SEQUENTIAL FILES:   The purpose of the proposed section is to introduce the concepts such as File characteristics, File Description for Fixed-Length Records, File-Control

IF ... ELSE STATEMENT: We are familiar with an easy form of the IF statement. The common form of the IF statement is as shown below: Each of the statement-1 and statem

Object-Computer - Configuration section: The computer name specifies a specific computer on which the object program is to be executed. The MEMORY SIZE is used to show the

REWRITE STATEMENT: The REWRITE statement has the format for a relative file as shown below, REWRITE record-name  [ FORM identifier ]