Write statement, COBOL Programming

Assignment Help:

WRITE STATEMENT:

The WRITE Statement verb releases a record in an output file. The syntax for the WRITE statement can be unlike depending on the output device and the medium used. The verb as explained here can be used only to print the results on continuous stationery through a line printer. The form for the WRITE statement in such a situation is

     WRITE   record-name     [FROM identifier-1]

The initial point to be noted is that in the situation of the READ statement the file name is to be specified, while in the case of the WRITE statement it is needed to mention the record name and not the file name. The phrase ADVANCING is used to control the vertical position of each record at the time of the printing on the stationery placed on the printer. 

Whenever the BEFORE phrase is used, then the record is printed before the stationary is advanced, while the AFTER phrase may be used when the intention is to advance the stationary first and then to print the record. When the integer-1 or identifier-1 is mentioned, then the stationary is advanced by the number of lines equivalent to the value of the integers-1 or to the present value of the identifier-1.

If the mnemonic-name is specified, then the printer will be advanced to the carriage control channel declared for the mnemonic-name in the SPECIAL-NAMES paragraph. This selection is provided so that the hardware names that may be peculiar to the particular computer require not appearing in the PROCEDURE DIVISION.

If the FROM option is used, the operation is equal to that of the MOVE identifier-1 TO record-name followed by the WRITE record-name without the FROM clause. It is illegal to use similar storage region for both the record-name and identifier-1.

It must be noted that after WRITE is executed the record is no longer available. 

 


Related Discussions:- Write statement

Move, can we move spaces to numeric field

can we move spaces to numeric field

Illustration of indexed tables, Illustration of indexed tables: Index ...

Illustration of indexed tables: Index items defined through the INDEXED phrase of the OCCURS clause are one type of indexes. There can be other type of index items that are de

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

Example of read statement, Example of read statement: Illustration: ...

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

Program using occurs clause, PROGRAM USING OCCURS CLAUSE: We have to w...

PROGRAM USING OCCURS CLAUSE: We have to write a simple program to demonstrate Occurs Clause. Get the employee details for 3 persons and compute the total salary. identifica

Multiply verb, MULTIPLY VERB:   The Multiply Verb causes one or more ...

MULTIPLY VERB:   The Multiply Verb causes one or more multiplicands to be multiplied by the multiplier and to store the products. The form of the MULTIPLY verb is as shown be

Perform with until option, PERFORM WITH UNTIL OPTION: The format is as...

PERFORM WITH UNTIL OPTION: The format is as shown below: Illustration:  A) Perform p-3 until i > 5. Here p-3 will be executed whenever i B)  Perform p-2 thru

Example of add verb, Example of add verb: (a) ADD A TO B. This illu...

Example of add verb: (a) ADD A TO B. This illustration represents that the value of A will be added to the value of B and the result will be stored in B.  The alignment of

DBMS, Comparing features of oracle rdbms with Mysql

Comparing features of oracle rdbms with Mysql

Renames clause, RENAMES CLAUSE: At times re-grouping of an elementary ...

RENAMES CLAUSE: At times re-grouping of an elementary data items in a record may be essential so that they can belong to the original as well as to the latest group. This is o

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