Example of open statement, COBOL Programming

Assignment Help:

Example of Open statement:

Illustration:

The OPEN INPUT TRANSACTION, OLD-MASTER OUTPUT NEW-MASTER.

The illustration represents that there are two input files named the TRANSACTION and OLD-MASTER and one output file known as the NEW-MASTER.  All these files are opened and these are prepared for reading or writing.

Illustration:

OPEN INPUT MARK-FILE.

OPEN OUTPUT RESULT-FILE.

The first OPEN statement opens the MARK-FILE in the input mode and the file is ready for the reading.  The later statement makes the RESULT-FILE ready for the writing. There may be numerous OPEN statements in a program.

 


Related Discussions:- Example of open statement

Program for screen section with files, PROGRAM FOR SCREEN SECTION WITH FILE...

PROGRAM FOR SCREEN SECTION WITH FILES: identification division.   program- id.   environment division.          input-output section.   file-control.     select

Rewrite statement, REWRITE statement: The REWRITE statement is used to...

REWRITE statement: The REWRITE statement is used to update the existing record in a disk file. The normal format is as shown below: REWRIE  record-name  [  FROM      ide

Program for if condition, PROGRAM FOR IF :   We have to write a progr...

PROGRAM FOR IF :   We have to write a program to check whether the given number is ODD or EVEN. Identification division. Program- id. Ifst. Environment division.

Open statement, OPEN STATEMENT: Whenever a READ or a WRITE operation i...

OPEN STATEMENT: Whenever a READ or a WRITE operation is executed on a file, then it should be open. The opening of a file may be completed with the help of the OPEN verb. With

Perform statement, PERFORM STATEMENT:   The PERFORM statement can be ...

PERFORM STATEMENT:   The PERFORM statement can be used to execute the group of consecutive statements written elsewhere in the program. We refer to this group of statements a

Program for inventory , PROGRAM FOR INVENTORY  We have to write a progr...

PROGRAM FOR INVENTORY  We have to write a program to update the inventory file. Consider 2 files,viz, invfile an tranfile. Invfile has 3 fields pno,name,qty. Tranfile has 3 fil

Rules of redefines clause, RULES OF REDEFINES CLAUSE The rules shown be...

RULES OF REDEFINES CLAUSE The rules shown below govern the use of the REDEFINES clause: (i) The level-number of data-name-1 and data-name-2 should be identical. (ii) Exce

Program for add verb, PROGRAM FOR ADD VERB: We have to write a simple ...

PROGRAM FOR ADD VERB: We have to write a simple program to elaborate the ADD verb. You can also use edit characters in the program. Identification division. Program- id.

Rules for constructing an arithmetic expression, Rules for constructing an ...

Rules for constructing an Arithmetic Expression: The rules for constructing an arithmetic expression are as shown below: (i) When an arithmetic expression specifies a calcu

Delete statement, DELETE STATEMENT: The format of the delete statement...

DELETE STATEMENT: The format of the delete statement is as shown below: DELETE   file-name RECORD   [  ;   INVALID   KEY  imperative-statement  ] Whenever the ACCESS MOD

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