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

Example of class condition, Example of Class condition: Let the BASIC-...

Example of Class condition: Let the BASIC-PAY be a data name in the card record defined with picture 9(5) V99. By reading the card we can test the value of the BASIC-PAY to ma

Program for screen section, PROGRAM FOR SCREEN SECTION:  identificatio...

PROGRAM FOR SCREEN SECTION:  identification division.   program- id.   environment division.   data division.   working-storage section.   01  a pic 9(2) value

Illustration of search verb, Illustration of Search verb: To illustrat...

Illustration of Search verb: To illustrate the other use of SEARCH verb, assume we wish to search the similar tab to find the number of persons whose deposited amount is more

Example of special-names - configuration section, Example of Special-names:...

Example of Special-names: Consider the illustration: Let the SPECIAL-NAMES paragraph be as shown: SPECIAL-NAMES. CHANNEL 1 IS PAGE-TOP. The Channel is related with the t

Rules of read statements, Rules of read statements: The next record is...

Rules of read statements: The next record is identified according to the rules as shown below: (i) Whenever the READ NEXT statement is the initial statement to be executed

Perform with times option, PERFORM WITH TIMES OPTION: The format of ...

PERFORM WITH TIMES OPTION: The format of a PERFORM TIMES statement is as shown below: Illustration:   A)  Perform the para-2 5 times. In this situation the specifie

Illustration of nested if statement, Illustration of nested if statement: ...

Illustration of nested if statement: Consider the nested sentence which is as shown below: The IF-ELSE pairs in this sentence can be detected by applying the rule whic

Compute verb, COMPUTE VERB: The COMPUTE verb is very powerful. All the...

COMPUTE VERB: The COMPUTE verb is very powerful. All the evaluations performed by the other 4 verbs can also be completed easily by using the COMPUTE verb. Its normal format i

Common form of the read statements, Common form of the READ statements: ...

Common form of the READ statements: Format 1 is the common form of the READ statements. Format 2 is used when the access mode is either random or dynamic. For illustration,

Example of level numbers - cobol programming, Example of Level numbers - co...

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

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