Example of read statement, COBOL Programming

Assignment Help:

Example of read statement:

Illustration:

READ OLD-MASTER AT END MOVE ZERO TO END-OF-RECORDS.

As a result of this statement, generally the next record from the OLD-MASTER file will be read. If there is no more record in the OLD-MASTER, the value zero will be moved to the field named END-OF-RECORDS.

Illustration:

READ TRANSACTION RECORD AT END GO TO PARA-END.

This illustration is similar to the former illustration. The next record from the TRANSACTION file will be read if it is available. If the file does not hold any extra records, the control will be transferred to the paragraph named PARA-END.

Illustration:  

READ KARD-FILE INTO IN-REC AT END

                                                 GO TO JOB-END.

This statement not only reads the next record into the record region of the KARD-FILE but also moves the record into the region name the IN-REC.  When there is no more record in the KARD-FILE, then the control is transferred to the paragraph named JOB-END.  If the record region of the KARD-FILE has been named KARD-REC, the above statement is alike to

READ KARD-FILE AT END GO TO JOB-END.

MOVE KARD-REC TO IN-REC.

It may be noted that if the record has been effectively read, it is now available in the

KARD-REC as well as IN-REC.


Related Discussions:- Example of read statement

Read statements - relative files, READ STATEMENTS: The common format f...

READ STATEMENTS: The common format for the read statements is as shown bellow. Format 1: READ file-name RECORD [ INTO   identifier ] [  ;  AT   END     imperative-s

Occurs, what does it used

what does it used

Example of file-control, Example of File-control: The assign clause as...

Example of File-control: The assign clause assigns a specific physical peripheral device name to a file. The physical peripheral device are machine-dependent. We use the devic

#title.cobol help , we have input file ,record layout is EMP ID (6 char) , ...

we have input file ,record layout is EMP ID (6 char) , EMP NAME (20 char), Designation (3 char),Salary (5 digit) Base Branch (10char) Grade (3 Alphanumeric). This is the input file

#Array, Major difference between file and array how does record read from a...

Major difference between file and array how does record read from array and file why we are not preparing array for real time

Rules for apply for the condition name, Rules for apply for the condition n...

Rules for apply for the condition name: The rules below apply for the condition name. (i) The Condition names should be explained at level 88. The level number starts in ma

Buffers - file characteristics, Buffers: The Modern computers are able...

Buffers: The Modern computers are able of handling I-O operations independent of the CPU by means of the hardware termed as data channel. For illustration, if two buffers a

Comparison of numeric operands - relational condition , Comparison of Numer...

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

Illustration of divide verb, Illustration of Divide verb: (a) DIVIDE 5...

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 sequential file creation & rewriting , Program for Sequential F...

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.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd