Read statements - relative files, COBOL Programming

READ STATEMENTS:

The common format for the read statements is as shown bellow.

Format 1:

READ file-name RECORD [ INTO   identifier ]

[  ;  AT   END     imperative-statements  ] 

Format 2:

READ   file-name RECORD   [  INTO   identifier ]

[ ;  INVALID   KEY   imperative-statement  ]        

Format 3:

READ   file-name   [ NEXT  ]   RECORD  [  INTO   identifier  ]

[   ;   AT   END   imperative-statements   ]

As usual, the READ statement reads a record of a file. The file should be open in either the input or I-O mode. 

 

Posted Date: 10/17/2012 8:12:38 AM | Location : United States







Related Discussions:- Read statements - relative files, Assignment Help, Ask Question on Read statements - relative files, Get Answer, Expert's Help, Read statements - relative files Discussions

Write discussion on Read statements - relative files
Your posts are moderated
Related Questions
THE SIMPLE SORT VERB: The process of sequencing the records in some preferred manner is termed as sorting. The Sorting is done upon some key data item in the record. For illus

Illustration of Perform with varying option: A) Perform para-3 varying the k from 1 by 1 until k > 10. Here para-3 will be constantly executed 10 times (For k=1,2,3, .....1

Abbreviation: The Consecutive relational conditions in a compound condition can be abbreviated in many cases as shown: (i) When the subjects in the consecutive relational c

Comparison of Numeric Operands: We are well-known with the kind of the relational condition where both the operands are numeric. The comparison in this situation is algebraic

RULES FOR SEARCH VERB: The rules apply for the SEARCH verb is as shown below: (1) The SEARCH verb can be applied only to a table that has the OCCURS clause and INDEXED phra

SEARCH VERB: The SEARCH verb is used to position elements in one-dimensional tables. Let us consider the following problem. Assume that each element of a table consists of thr

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

ARITHMETIC VERBS: Most of the problems need some computations to be performed on the input or intermediate data that are numeric in nature. The Arithmetic verbs are used to pe

Example of If- else statement Illustration:   IF   QUANTITY IS NUMERIC AND QUANTITY IS POSITIVE          MOVE ZERO TO ERROR-CODE. COMPUTE SALES VALUE=QUANTITY*RATE

Format for COBOL Programs: The COBOL is a high-level language. Therefore, a COBOL program can be executed on a computer for which a COBOL compiler exists. The compiler transla