Write statement - relative files, COBOL Programming

WRITE Statement:

     The WRITE statement for a relative file has the format which is as shown below.

         WRITE  record-name   [ FORM   identifier ]

                                            [  ;   INVALID KEY  imperative statement  ]

At the time of the execution of WRITE statement, the file should be open either in the OUTPUT or I-O mode. For illustration, assume REL-OUTPUT AND REL-KEY are the record name and relative key data item name for a relative file opened in the I-O mode. Then, upon execution of the statements below:

MOVE     50  TO  REL-KEY.

WRITE REL-OUTPUT  INVALID KEY GO TO PARA-INVALID.

The record is written at the 50th record location on the file.     

The imperative statement of INVALID KEY phrase is the execution in the situation as shown below:

(i)  When a try is made to write beyond the externally-defined boundaries of the file.

(ii) When a try is made to write in the record place that already contains a valid record.

 

Posted Date: 10/17/2012 8:15:37 AM | Location : United States







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

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

Example of condition names: The illustration below is of the use of the condition names  77  MARITAL-STATUS     PIC    9   88  SINGLE    VALUE    IS     ZERO   88  MA

, (Comma) : A comma, whenever used in a picture, is considered as an insertion character and inserted wherever it become visible. There can be more than one comma in the pictu

77 level used for- It is Elementary level item. it Cannot be subdivisions of other items or cannot be qualified, or they can be subdivided themselves.

Currency Sign - edit characters for numeric data: $ (Currency Sign): The single currency sign can appear at the leftmost place of a picture. In that situation the $ cha

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

RULES OF MOVE VERB:  The Data movement is managed by the rules which are as shown below: (a) The contents of the identifier - 1 or the value of the literal - 1 is moved to

Plus Sign - edit characters for numeric data: + (Plus Sign) : A plus sign is alike to minus sign except that when the item is positive, +sign will be inserted rather th

LABEL RECORD CLAUSE: This clause specifies whether or not the standard header and trailer labels must be present in the magnetic-tape files. VALUE OF CLAUSE: The VAL

DECLARATIVE and FILE STATUS Clause: The input-output exception condition in the situation of a direct access files can be handled by a declarative procedure in a manner simila