Write statement, COBOL Programming

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. 

 

Posted Date: 10/16/2012 5:37:34 AM | Location : United States







Related Discussions:- Write statement, Assignment Help, Ask Question on Write statement, Get Answer, Expert's Help, Write statement Discussions

Write discussion on Write statement
Your posts are moderated
Related Questions
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

OCCURS CLAUSE - PROGRAM: We have to write a program to demonstrate the occurs clause. Get names of the students and show them on the screen.  identification division.

Literals: The actual values can too appear in a program. These values are termed as literals. For illustration, the statement MOVE 0 TO TOTAL indicates that the value zero wil

NEGATED SIMPLE CONDITION: Any of the easy condition explained can be preceded by the logical operator NOT. The consequence of placing the operator NOT before an easy condition

Rules for Simple sort verb: The work file is to be defined by a sort elaboration entry (SD entry).The format of SD entry is as shown below. The rules below should be taken

PROGRAMS FOR REDEFINES CLAUSE: We have to write a simple program to explain the REDEFINES clause at 01 level. identification division. program- id. Redef. environment

Floating Insertion   The currency symbol ($) can emerge in multiples on the left-hand side of the picture. In this situation the character will be treated in similar way as t

Example of Level numbers - cobol programming: To explain the hierarchical structure introduced above, the concept of the level number is employed in COBOL. The most broad

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

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