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

Blank when zero - edit characters for numeric data, BLANK WHEN ZERO: ...

BLANK WHEN ZERO: BLANK WHEN ZERO is an editing clause that may be used along with a picture. This will set the whole data item to blanks of its value is equal to zero. Though,

Illustration of perform statement, Illustration of perform statement: ...

Illustration of perform statement: PERFORM    CALCUALTE-TAX. In this illustration, the CALCULATE-TAX is either a section name or paragraph name. Assume that it is a section

Rounded option, ROUNDED OPTION: Let us consider the DATA DIVISION entr...

ROUNDED OPTION: Let us consider the DATA DIVISION entries which are as shown below: Now, subsequent to the execution of the statement ADD A B GIVING C, the C will hold

File status clause, FILE STATUS clause: This clause has been involved ...

FILE STATUS clause: This clause has been involved in the above syntax for completeness. The ORGANIZATION, REVERSE, ACCESS and STATUS clause can be specified in any order.

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

Valid and invalid word - cobol words, Valid and Invalid Word - Cobol words:...

Valid and Invalid Word - Cobol words: Valid Word             Invalid Word & Reason emp-sal                  -pay   ( it starts with a hyphen)  TOTAL MARK (blank space em

Use of evaluate statement, Evaluate is like a case statement & Evaluate  s...

Evaluate is like a case statement & Evaluate  stamenet can be used to replace nested Ifs. The difference b/w EVALUATE and case is that there is no 'break' is required for EVALUATE

Example of nested if statement, Example of Nested if statement: Illus...

Example of Nested if statement: Illustration: Consider the following sentence The nested IF sentence holds two IFs and one ELSE. The IF-ELSE couple has been marke

Level numbers - cobol programming, LEVEL NUMBERS: The COBOL makes use ...

LEVEL NUMBERS: The COBOL makes use of the level number concept to explain the hierarchical data structure. A level number is a 2 digit number. The permitted level numbers a

Column and field in cobol program, Column and Field in COBOL program: ...

Column and Field in COBOL program: In COBOL there are 2 types of entries termed as margin A and margin B entries. The Margin A entries start from the column 8, 9, 10 or 11 and

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