Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

6.2.31 REWRITE Statement



The REWRITE statement logically replaces an existing record in a direct-access file. When the REWRITE statement is executed, the associated direct-access file must be open in I-O mode.


X >_Workstation_> Under AIX, OS/2, and Windows the REWRITE statement is not
X supported for line sequential files. <_Workstation_<


    ___ Format _____________________________________________________________ 
   |                                                                        |
   | >>__REWRITE__record-name-1__ ____________________ ___________________> |
   |                             |_FROM__identifier-1_|                     |
   |                                                                        |
   | >__ __________________________________________ ______________________> |
   |    |_INVALID__ _____ __imperative-statement-1_|                        |
   |               |_KEY_|                                                  |
   |                                                                        |
   | >__ ______________________________________________ __________________> |
   |    |_NOT INVALID__ _____ __imperative-statement-2_|                    |
   |                   |_KEY_|                                              |
   |                                                                        |
   | >__ _____________ __________________________________________________>< |
   |    |_END-REWRITE_|                                                     |
   |                                                                        |
   |________________________________________________________________________|
record-name-1
Must be the name of a logical record in a Data Division FD entry. The record-name can be qualified.


X Record-name-1 can define a floating-point data item or DBCS data item.
X Identifier-1 must be a DBCS data item if record-name-1 is a DBCS data
X item.

FROM phrase
The result of the execution of the REWRITE statement with the FROM identifier-1 phrase is equivalent to the execution of the following statements in the order specified.


         MOVE identifier-1 TO record-name-1.
         REWRITE record-name-1

The MOVE is performed according to the rules for the MOVE statement without the CORRESPONDING phrase.

identifier-1
Identifier-1 can be one of the following:

Identifier-1 and record-name-1 must not refer to the same storage area.

After the REWRITE statement is executed, the information is still available in identifier-1 (See "INTO/FROM Identifier Phrase" under "Common Processing Facilities" in topic 6.1.8.9).

Subtopics:



Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.